(self, tmp_path)
| 122 | assert_raises(OSError, ds.open, invalid_file) |
| 123 | |
| 124 | def test_ValidGzipFile(self, tmp_path): |
| 125 | try: |
| 126 | import gzip |
| 127 | except ImportError: |
| 128 | # We don't have the gzip capabilities to test. |
| 129 | pytest.skip() |
| 130 | # Test datasource's internal file_opener for Gzip files. |
| 131 | ds = datasource.DataSource(tmp_path) |
| 132 | filepath = os.path.join(tmp_path, 'foobar.txt.gz') |
| 133 | fp = gzip.open(filepath, 'w') |
| 134 | fp.write(magic_line) |
| 135 | fp.close() |
| 136 | fp = ds.open(filepath) |
| 137 | result = fp.readline() |
| 138 | fp.close() |
| 139 | assert_equal(magic_line, result) |
| 140 | |
| 141 | def test_ValidBz2File(self, tmp_path): |
| 142 | try: |
nothing calls this directly
no test coverage detected