It is possible to use `wave.read` and `wave.write` with a path-like object
(self)
| 433 | |
| 434 | class WaveOpen(unittest.TestCase): |
| 435 | def test_open_pathlike(self): |
| 436 | """It is possible to use `wave.read` and `wave.write` with a path-like object""" |
| 437 | with tempfile.NamedTemporaryFile(delete_on_close=False) as fp: |
| 438 | cases = ( |
| 439 | FakePath(fp.name), |
| 440 | FakePath(os.fsencode(fp.name)), |
| 441 | os.fsencode(fp.name), |
| 442 | ) |
| 443 | for fake_path in cases: |
| 444 | with self.subTest(fake_path): |
| 445 | with wave.open(fake_path, 'wb') as f: |
| 446 | f.setnchannels(1) |
| 447 | f.setsampwidth(2) |
| 448 | f.setframerate(44100) |
| 449 | |
| 450 | with wave.open(fake_path, 'rb') as f: |
| 451 | pass |
| 452 | |
| 453 | |
| 454 | if __name__ == '__main__': |
nothing calls this directly
no test coverage detected