Ejemplo n.º 1
0
 def test_mpd2xmlstr(self):
     # set maxDiff to None for Python2.6
     self.maxDiff = None
     with open('./tests/mpd-samples/sample-001.mpd') as f:
         # read the test MPD
         mpd = MPEGDASHParser.parse(f.read())
         # get the MPD as an XML string
         xmlstrout = MPEGDASHParser.toprettyxml(mpd)
         # then parse that string
         mpd2 = MPEGDASHParser.parse(xmlstrout)
         # get the reparsed MPD as a string
         xmlstrout2 = MPEGDASHParser.toprettyxml(mpd2)
         # and check the are equal
         self.assertEqual(xmlstrout, xmlstrout2)