Beispiel #1
0
 def test_read_compressed_write_compressed(self):
     gzfs = GzipFileStream(self.gz_path, 'rb')
     out = GzipFileStream(self.test_path, 'w')
     for line in gzfs:
         out.write(line)
     out.close()
     gzfs.close()
     self.assertTrue(is_gzipped(self.test_path))
     self.assertSameFiles([self.gz_path, self.test_path], 
             exclude_line_endings=True)
Beispiel #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()