Example #1
0
 def setUp(self):
     self.track1 = mediapackage.Track(uri=self.path_track1,
                                      duration=532,
                                      flavor="presentation/source")
     self.track2 = mediapackage.Track(uri=self.path_track2,
                                      duration=532,
                                      flavor="presenter/source")
     self.catalog = mediapackage.Catalog(uri=self.path_catalog,
                                         flavor="catalog/source")
     self.attach = mediapackage.Attachment(uri=self.path_attach,
                                           flavor="attachment/source")
     self.other = mediapackage.Other(uri=self.path_other,
                                     flavor="other/source")
Example #2
0
 def test_element_equality(self):
     track = mediapackage.Track(self.path_track1, 532,
                                "presentation/source")
     attach = mediapackage.Attachment(self.path_attach, "attachment/source")
     catalog = mediapackage.Catalog(self.path_catalog, "catalog/source")
     other = mediapackage.Other(self.path_other, "other/source")
     self.assertFalse(track == self.track2)
     self.assertFalse(track == attach)
     self.assertFalse(attach == catalog)
     self.assertFalse(catalog == other)
     self.assertFalse(other == track)
     self.assertTrue(track == self.track1)
     self.assertTrue(attach == self.attach)
     self.assertTrue(catalog == self.catalog)
     self.assertTrue(other == self.other)
Example #3
0
    def test_side_by_side(self):
        w = worker.Worker(self.dispatcher, self.repo1, self.logger,
                          self.client)

        baseDir = get_resource('sbs')
        path_track1 = path.join(baseDir, 'SCREEN.mp4')
        path_track2 = path.join(baseDir, 'CAMERA.mp4')
        path_catalog = path.join(baseDir, 'episode.xml')
        path_attach = path.join(baseDir, 'attachment.txt')
        path_capture_agent_properties = path.join(
            baseDir, 'org.opencastproject.capture.agent.properties')
        path_other = path.join(baseDir, 'manifest.xml')

        track1 = mediapackage.Track(uri=path_track1,
                                    duration=532,
                                    flavor="presentation/source")
        track2 = mediapackage.Track(uri=path_track2,
                                    duration=532,
                                    flavor="presenter/source")
        catalog = mediapackage.Catalog(uri=path_catalog,
                                       flavor="catalog/source")
        attach = mediapackage.Attachment(uri=path_attach,
                                         flavor="attachment/source")
        other = mediapackage.Other(uri=path_other, flavor="other/source")

        self.mp.add(path_track1, mediapackage.TYPE_TRACK,
                    "presentation/source", "video/mpeg", 532)
        self.mp.add(path_track2, mediapackage.TYPE_TRACK, "presenter/source",
                    "video/mpeg", 532)
        self.mp.add(path_catalog, mediapackage.TYPE_CATALOG, "catalog/source",
                    "text/xml")
        self.mp.add(path_attach, mediapackage.TYPE_ATTACHMENT,
                    "attachment/source", "text/xml")
        self.mp.add(path_other, mediapackage.TYPE_OTHER, "other/source",
                    "text/xml")

        filename = '/tmp/sidebyside.mpeg'
        w.enqueue_job_by_name('sidebyside', self.mp, {'location': filename})
        time.sleep(2)
        self.assertTrue(os.path.exists(filename))