Beispiel #1
0
    def setUp(self):
        utils.http_request = lambda x, y=False: b'xxx'
        self.fd, self.dbfile = tempfile.mkstemp()
        self.cadir = tempfile.mkdtemp()
        preview = os.path.join(self.cadir, 'preview.png')
        open(preview, 'a').close()
        config.config()['agent']['database'] = 'sqlite:///' + self.dbfile
        config.config()['capture']['command'] = 'touch {{dir}}/{{name}}.mp4'
        config.config()['capture']['directory'] = self.cadir
        config.config()['capture']['preview'] = [preview]
        config.config()['service-capture.admin'] = ['']

        # Mock event
        db.init()
        self.event = db.BaseEvent()
        self.event.uid = '123123'
        self.event.title = u'äüÄÜß'
        self.event.start = utils.timestamp()
        self.event.end = self.event.start
        self.event.status = db.Status.UPCOMING
        data = [{'data': u'äüÄÜß',
                 'fmttype': 'application/xml',
                 'x-apple-filename': 'episode.xml'},
                {'data': u'äüÄÜß',
                 'fmttype': 'application/xml',
                 'x-apple-filename': 'series.xml'},
                {'data': u'event.title=äüÄÜß\n' +
                         u'org.opencastproject.workflow.config.x=123\n' +
                         u'org.opencastproject.workflow.definition=fast',
                 'fmttype': 'application/text',
                 'x-apple-filename': 'org.opencastproject.capture.agent' +
                                     '.properties'}]
        self.event.set_data({'attach': data})
Beispiel #2
0
    def setUp(self):
        config.config()['services']['org.opencastproject.capture.admin'] = ['']

        # db
        self.fd, self.dbfile = tempfile.mkstemp()
        config.config()['agent']['database'] = 'sqlite:///' + self.dbfile
        db.init()
Beispiel #3
0
    def setUp(self):
        config.config()['service-capture.admin'] = ['']

        # db
        self.fd, self.dbfile = tempfile.mkstemp()
        config.config()['agent']['database'] = 'sqlite:///' + self.dbfile
        db.init()
Beispiel #4
0
    def setUp(self):
        utils.http_request = lambda x, y=False: b'xxx'
        self.fd, self.dbfile = tempfile.mkstemp()
        config.config()['agent']['database'] = 'sqlite:///' + self.dbfile
        config.config()['service-scheduler'] = ['']

        # Mock event
        db.init()
Beispiel #5
0
    def setUp(self):
        utils.http_request = lambda x, y=False: b'xxx'
        self.fd, self.dbfile = tempfile.mkstemp()
        config.config()['agent']['database'] = 'sqlite:///' + self.dbfile
        config.config()['service-capture.admin'] = ['']

        # Mock event
        db.init()
Beispiel #6
0
    def setUp(self):
        ingest.http_request = lambda x, y=False: b'xxx'
        self.fd, self.dbfile = tempfile.mkstemp()
        self.cadir = tempfile.mkdtemp()
        config.config('agent')['database'] = 'sqlite:///' + self.dbfile
        config.config('capture')['directory'] = self.cadir
        config.config()['services']['org.opencastproject.ingest'] = ['']
        config.config()['services']['org.opencastproject.capture.admin'] = ['']

        # Mock event
        db.init()
        event = db.RecordedEvent()
        event.uid = '123123'
        event.status = db.Status.FINISHED_RECORDING
        event.start = utils.timestamp()
        event.end = event.start + 1
        prop = 'org.opencastproject.capture.agent.properties'
        dcns = 'http://www.opencastproject.org/xsd/1.0/dublincore/'
        data = [{
            'data': u'äü%sÄÜß' % dcns,
            'fmttype': 'application/xml',
            'x-apple-filename': 'episode.xml'
        }, {
            'data': u'äü%sÄÜß' % dcns,
            'fmttype': 'application/xml',
            'x-apple-filename': 'series.xml'
        }, {
            'data':
            u'event.title=äüÄÜß\n' +
            u'org.opencastproject.workflow.config.x=123\n' +
            u'org.opencastproject.workflow.definition=fast',
            'fmttype':
            'application/text',
            'x-apple-filename':
            prop
        }]
        event.set_data({'attach': data})

        # Create recording
        os.mkdir(event.directory())
        trackfile = os.path.join(event.directory(), 'test.mp4')
        open(trackfile, 'wb').close()
        event.set_tracks([('presenter/source', trackfile)])
        session = db.get_session()
        session.add(event)
        session.commit()
        self.event = db.RecordedEvent(event)
Beispiel #7
0
    def setUp(self):
        utils.http_request = lambda x, y=False: b'xxx'
        ingest.http_request = lambda x, y=False: b'xxx'
        self.fd, self.dbfile = tempfile.mkstemp()
        self.cadir = tempfile.mkdtemp()
        config.config()['agent']['database'] = 'sqlite:///' + self.dbfile
        config.config()['capture']['directory'] = self.cadir
        config.config()['service-ingest'] = ['']
        config.config()['service-capture.admin'] = ['']

        # Mock event
        db.init()
        self.event = db.RecordedEvent()
        self.event.uid = '123123'
        self.event.start = utils.timestamp()
        self.event.end = self.event.start + 1
        data = [{'data': u'äüÄÜß',
                 'fmttype': 'application/xml',
                 'x-apple-filename': 'episode.xml'},
                {'data': u'äüÄÜß',
                 'fmttype': 'application/xml',
                 'x-apple-filename': 'series.xml'},
                {'data': u'event.title=äüÄÜß\n' +
                         u'org.opencastproject.workflow.config.x=123\n' +
                         u'org.opencastproject.workflow.definition=fast',
                 'fmttype': 'application/text',
                 'x-apple-filename': 'org.opencastproject.capture.agent' +
                                     '.properties'}]
        self.event.set_data({'attach': data})

        # Create recording
        os.mkdir(self.event.directory())
        trackfile = os.path.join(self.event.directory(), 'test.mp4')
        with open(trackfile, 'wb') as f:
            f.write(b'123')
        self.event.set_tracks([('presenter/source', trackfile)])
Beispiel #8
0
 def setUp(self):
     self.fd1, self.dbfile = tempfile.mkstemp()
     config.config()['agent']['database'] = 'sqlite:///' + self.dbfile
     db.init()
Beispiel #9
0
 def setUp(self):
     self.fd1, self.dbfile = tempfile.mkstemp()
     self.fd2, self.previewfile = tempfile.mkstemp()
     config.config()['capture']['preview'] = [self.previewfile]
     config.config()['agent']['database'] = 'sqlite:///' + self.dbfile
     db.init()
Beispiel #10
0
 def setUp(self):
     self.fd1, self.dbfile = tempfile.mkstemp()
     self.fd2, self.previewfile = tempfile.mkstemp()
     config.config()['capture']['preview'] = [self.previewfile]
     config.config()['agent']['database'] = 'sqlite:///' + self.dbfile
     db.init()