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