예제 #1
0
 def test_read_compressed_read_uncompressed(self):
     gzfs = GzipFileStream(self.gz_path, 'rb')
     out = open(self.test_path, 'wb')
     for line in gzfs:
         out.write(line)
     out.close()
     gzfs.close()
     self.assertSameFiles([self.ungz_path, self.test_path],
             exclude_line_endings=True)
예제 #2
0
 def test_read(self):
     gzfs = GzipFileStream(self.gz_path, 'rb')
     gzfs_str = gzfs.read()
     with open(self.ungz_path, 'rb') as fs:
         self.assertEqual(gzfs_str, fs.read())
     gzfs.close()