def test_xz_archive(self): tfobj = _get_xzfile(self.filenames) archive = layers.Archive(tfobj) tar = tarfile.open(fileobj=archive) members = tar.getmembers() for tarinfo in members: self.assertIn(tarinfo.name, self.filenames)
def test_tar_serialization(self): tfobj = _get_tarfile(self.filenames) archive = layers.Archive(tfobj) tar = tarfile.open(fileobj=archive) infos = layers.read_tarfile(tar) for tarinfo in infos: self.assertIn(tarinfo[0], self.filenames) self.assertTrue(tarinfo[1:] == ('f', False, 512, 0, 420, 0, 0))
def test_info_serialization(self): tfobj = _get_tarfile(self.filenames) archive = layers.Archive(tfobj) tar = tarfile.open(fileobj=archive) members = tar.getmembers() for tarinfo in members: sinfo = layers.serialize_tar_info(tarinfo) self.assertTrue(sinfo[0] in self.filenames) self.assertTrue(sinfo[1:] == ('f', False, 512, 0, 420, 0, 0))