Esempio n. 1
0
    def test_save_in_zip(self):
        mp = mediapackage.Mediapackage()
        mp.add(self.track1)
        mp.add(self.track2)
        mp.add(self.catalog)
        mp.marshalDublincore()

        da = minidom.parseString(serializer.set_episode(mp))
        db = minidom.parse(self.path_catalog)

        for name in ["dcterms:title", "dcterms:identifier", "dcterms:created"]:
            try:
                self.assertEqual(da.getElementsByTagName(name)[0].firstChild.wholeText.strip().strip("\n"), 
                                 db.getElementsByTagName(name)[0].firstChild.wholeText.strip().strip("\n"))
            except IndexError:
                continue
Esempio n. 2
0
    def test_save_in_zip(self):
        mp = mediapackage.Mediapackage()
        mp.add(self.track1)
        mp.add(self.track2)
        mp.add(self.catalog)
        mp.marshalDublincore()

        da = minidom.parseString(serializer.set_episode(mp))
        db = minidom.parse(self.path_catalog)

        for name in ["dcterms:title", "dcterms:identifier", "dcterms:created"]:
            try:
                self.assertEqual(da.getElementsByTagName(name)[0].firstChild.wholeText.strip().strip("\n"), 
                                 db.getElementsByTagName(name)[0].firstChild.wholeText.strip().strip("\n"))
            except IndexError:
                continue
Esempio n. 3
0
    def test_serializer(self):
        mp = mediapackage.Mediapackage()
        mp.add(self.track1)
        mp.add(self.track2)
        mp.add(self.catalog)
        mp.status = mediapackage.SCHEDULED
        mp.notes = u"Nota de Prueba <?php Caracteres ñ I'm raros >"

        try:
            parseString(serializer.set_manifest(mp))
        except ExpatError:
            raise AssertionError("Error in serializer.set_manifest")

        try:
            parseString(serializer.set_episode(mp))
        except ExpatError:
            raise AssertionError("Error in serializer.set_episode")

        try:
            json.loads(serializer.set_properties(mp))
        except ExpatError:
            raise AssertionError("Error in serializer.set_properties")
Esempio n. 4
0
    def test_serializer(self):
        mp = mediapackage.Mediapackage()
        mp.add(self.track1)
        mp.add(self.track2)
        mp.add(self.catalog)
        mp.status = mediapackage.PENDING
        mp.notes = u"Nota de Prueba <?php Caracteres ñ I'm raros >"

        try:
            parseString(serializer.set_manifest(mp))
        except ExpatError:
            raise AssertionError("Error in serializer.set_manifest")

        try:
            parseString(serializer.set_episode(mp))
        except ExpatError:
            raise AssertionError("Error in serializer.set_episode")

        try:
            parseString(serializer.set_properties(mp))
        except ExpatError:
            raise AssertionError("Error in serializer.set_properties")