def test_is_closed_gzip_file(self): path = os.path.join(DATA_DIR, 'foo.tar.gz') file_object = gzip.open(path) file_object.close() self.assertTrue(MetadataFileContext._is_closed(file_object))
def test_is_closed_file(self): path = os.path.join(DATA_DIR, 'foo.tar.gz') # opening as a regular file, not with gzip file_object = open(path) file_object.close() self.assertTrue(MetadataFileContext._is_closed(file_object))