comparison pytouhou/formats/fmt.py @ 385:d8aab27a2ab2

Add missing imports, and remove side-effects in asserts.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Sat, 20 Oct 2012 20:44:11 +0200
parents cddfd3cb4797
children d1f0bb0b7a17
comparison
equal deleted inserted replaced
384:690b5faaa0e6 385:d8aab27a2ab2
59 track.wBitsPerSample) = unpack('<HHLLHH', file.read(16)) 59 track.wBitsPerSample) = unpack('<HHLLHH', file.read(16))
60 60
61 assert track.wFormatTag == 1 # We don’t support non-PCM formats 61 assert track.wFormatTag == 1 # We don’t support non-PCM formats
62 assert track.dwAvgBytesPerSec == track.dwSamplesPerSec * track.wBlockAlign 62 assert track.dwAvgBytesPerSec == track.dwSamplesPerSec * track.wBlockAlign
63 assert track.wBlockAlign == track.wChannels * track.wBitsPerSample // 8 63 assert track.wBlockAlign == track.wChannels * track.wBitsPerSample // 8
64 assert b'\00\00\00\00' == file.read(4) 64 zero = file.read(4)
65 assert b'\00\00\00\00' == zero
65 66
66 self.append(track) 67 self.append(track)
67 68
68 return self 69 return self
69 70