Example #1
0
    def test_save_system_zip(self):
        mp = mediapackage.Mediapackage()
        mp.add(self.track1,mediapackage.TYPE_TRACK, "presentation/source", "video/mpeg", 532)
        mp.add(self.track2,mediapackage.TYPE_TRACK, "presenter/source", "video/mpeg", 532)
        mp.add(self.catalog,mediapackage.TYPE_CATALOG, "catalog/source","xml")
        tmppath = mkdtemp()
        repo = repository.Repository(tmppath)
        repo.add(mp)
        path_zip = "system.zip"

        serializer.save_system_zip(mp,path_zip)
        zfile = zipfile.ZipFile(path_zip,'r')
        files=zfile.namelist()
        
        for element in mp.getElements():
            self.assertTrue(path.split(element.getURI())[1] in files)
        rmtree(tmppath)
        remove(path_zip)
Example #2
0
    def test_save_system_zip(self):
        mp = mediapackage.Mediapackage()
        mp.add(self.track1,mediapackage.TYPE_TRACK, "presentation/source", "video/mpeg", 532)
        mp.add(self.track2,mediapackage.TYPE_TRACK, "presenter/source", "video/mpeg", 532)
        mp.add(self.catalog,mediapackage.TYPE_CATALOG, "catalog/source","xml")
        tmppath = mkdtemp()
        repo = repository.Repository(tmppath)
        repo.add(mp)
        path_zip = "system.zip"

        serializer.save_system_zip(mp,path_zip)
        zfile = zipfile.ZipFile(path_zip,'r')
        files=zfile.namelist()
        
        for element in mp.getElements():
            self.assertTrue(path.split(element.getURI())[1] in files)
        rmtree(tmppath)
        remove(path_zip)