(self)
| 2509 | class OpenTestCase(unittest.TestCase): |
| 2510 | |
| 2511 | def test_binary_modes(self): |
| 2512 | with open(io.BytesIO(COMPRESSED_100_PLUS_32KB), "rb") as f: |
| 2513 | self.assertEqual(f.read(), DECOMPRESSED_100_PLUS_32KB) |
| 2514 | with io.BytesIO() as bio: |
| 2515 | with open(bio, "wb") as f: |
| 2516 | f.write(DECOMPRESSED_100_PLUS_32KB) |
| 2517 | file_data = decompress(bio.getvalue()) |
| 2518 | self.assertEqual(file_data, DECOMPRESSED_100_PLUS_32KB) |
| 2519 | with open(bio, "ab") as f: |
| 2520 | f.write(DECOMPRESSED_100_PLUS_32KB) |
| 2521 | file_data = decompress(bio.getvalue()) |
| 2522 | self.assertEqual(file_data, DECOMPRESSED_100_PLUS_32KB * 2) |
| 2523 | |
| 2524 | def test_text_modes(self): |
| 2525 | # empty input |
nothing calls this directly
no test coverage detected