MCPcopy Create free account
hub / github.com/numpy/numpy / test_ValidGzipFile

Method test_ValidGzipFile

numpy/lib/tests/test__datasource.py:125–139  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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:

Callers

nothing calls this directly

Calls 5

assert_equalFunction · 0.90
joinMethod · 0.45
openMethod · 0.45
writeMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected