Пример #1
0
    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))
Пример #2
0
    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))
Пример #3
0
    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))
Пример #4
0
    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))