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