(self, tmp_path)
| 139 | assert_equal(magic_line, result) |
| 140 | |
| 141 | def test_ValidBz2File(self, tmp_path): |
| 142 | try: |
| 143 | import bz2 |
| 144 | except ImportError: |
| 145 | # We don't have the bz2 capabilities to test. |
| 146 | pytest.skip() |
| 147 | # Test datasource's internal file_opener for BZip2 files. |
| 148 | ds = datasource.DataSource(tmp_path) |
| 149 | filepath = os.path.join(tmp_path, 'foobar.txt.bz2') |
| 150 | fp = bz2.BZ2File(filepath, 'w') |
| 151 | fp.write(magic_line) |
| 152 | fp.close() |
| 153 | fp = ds.open(filepath) |
| 154 | result = fp.readline() |
| 155 | fp.close() |
| 156 | assert_equal(magic_line, result) |
| 157 | |
| 158 | |
| 159 | class TestDataSourceExists: |
nothing calls this directly
no test coverage detected