(self)
| 373 | self.assertEqual(fact_samples, nframes) |
| 374 | |
| 375 | def test_pcm_has_no_fact_chunk(self): |
| 376 | with tempfile.NamedTemporaryFile(delete_on_close=False) as fp: |
| 377 | filename = fp.name |
| 378 | self.addCleanup(unlink, filename) |
| 379 | |
| 380 | with wave.open(filename, 'wb') as w: |
| 381 | w.setnchannels(1) |
| 382 | w.setsampwidth(2) |
| 383 | w.setframerate(22050) |
| 384 | w.writeframes(b'\x00\x00' * 100) |
| 385 | |
| 386 | with open(filename, 'rb') as f: |
| 387 | f.read(12) |
| 388 | while True: |
| 389 | chunk_id = f.read(4) |
| 390 | if len(chunk_id) < 4: |
| 391 | break |
| 392 | chunk_size = struct.unpack('<L', f.read(4))[0] |
| 393 | self.assertNotEqual(chunk_id, b'fact') |
| 394 | f.seek(chunk_size + (chunk_size & 1), 1) |
| 395 | |
| 396 | @support.subTests('arg', ( |
| 397 | # rounds to 0, should raise: |
nothing calls this directly
no test coverage detected