def test_account_details(self, get): get.return_value = load_response(200, 'fixtures/account_details.json') resp = self.zen.account.details() self.assertEquals(resp.code, 200) self.assertEquals(resp.body['account_state'], 'active') self.assertEquals(resp.body['minutes_used'], 12549)
def test_account_integration(self, put): put.return_value = load_response(204) resp = self.zen.account.integration() self.assertEquals(resp.code, 204) self.assertEquals(resp.body, None)
def test_job_details(self, get): get.return_value = load_response(200, 'fixtures/job_details.json') resp = self.zen.job.details(1234) self.assertEquals(resp.code, 200) self.assertTrue(resp.body['job']['id'] > 0) self.assertEquals(len(resp.body['job']['output_media_files']), 1)
def test_reports_vod(self, get): get.return_value = load_response(200, 'fixtures/report_vod.json') resp = self.zen.report.vod() self.assertEquals(resp.code, 200) self.assertEquals(resp.body['total']['encoded_minutes'], 6) self.assertEquals(resp.body['total']['billable_minutes'], 8)
def test_job_create_list(self, post): post.return_value = load_response(201, 'fixtures/job_create_live.json') resp = self.zen.job.create(live_stream=True) self.assertEquals(resp.code, 201) self.assertTrue(resp.body['id'] > 0) self.assertEquals(len(resp.body['outputs']), 1)
def test_job_create(self, post): post.return_value = load_response(201, 'fixtures/job_create.json') response = self.client.job.create('http://www.ibiblio.org/openvideo/video/umd/anni001.mpg') self.assertEquals(response.code, 201) self.assertTrue(response.body['id'] > 0) self.assertEquals(len(response.body['outputs']), 1)
def test_account_create(self, post): post.return_value = load_response(201, 'fixtures/account_create.json') response = self.zen.account.create('*****@*****.**', tos=1) self.assertEquals(response.code, 201) self.assertEquals(response.body['password'], 'foo') self.assertEquals(response.body['api_key'], 'abcd1234')
def test_job_create(self, post): post.return_value = load_response(201, 'fixtures/job_create.json') resp = self.zen.job.create('s3://zencodertesting/test.mov') self.assertEquals(resp.code, 201) self.assertTrue(resp.body['id'] > 0) self.assertEquals(len(resp.body['outputs']), 1)
def test_reports_live(self, get): get.return_value = load_response(200, 'fixtures/report_live.json') resp = self.zen.report.live() self.assertEquals(resp.code, 200) self.assertEquals(resp.body['total']['stream_hours'], 5) self.assertEquals(resp.body['total']['encoded_hours'], 5) self.assertEquals(resp.body['statistics']['length'], 5)
def test_reports_all(self, get): get.return_value = load_response(200, 'fixtures/report_all.json') resp = self.zen.report.all() self.assertEquals(resp.code, 200) self.assertEquals(resp.body['total']['live']['stream_hours'], 5) self.assertEquals(resp.body['total']['live']['encoded_hours'], 5) self.assertEquals(resp.body['total']['vod']['encoded_minutes'], 6) self.assertEquals(resp.body['total']['vod']['billable_minutes'], 8) self.assertEquals(resp.body['statistics']['live']['length'], 2)
def test_reports_all_date_filter(self, get): get.return_value = load_response(200, 'fixtures/report_all_date.json') start = datetime.date(2013, 5, 13) end = datetime.date(2013, 5, 13) resp = self.zen.report.all(start_date=start, end_date=end) self.assertEquals(resp.code, 200) self.assertEquals(resp.body['statistics']['vod'][0]['encoded_minutes'], 5) self.assertEquals(resp.body['statistics']['vod'][0]['billable_minutes'], 0) self.assertEquals(resp.body['statistics']['live'][0]['stream_hours'], 1) self.assertEquals(resp.body['statistics']['live'][0]['total_hours'], 2) self.assertEquals(resp.body['total']['vod']['encoded_minutes'], 5) self.assertEquals(resp.body['total']['vod']['billable_minutes'], 0) self.assertEquals(resp.body['total']['live']['stream_hours'], 1) self.assertEquals(resp.body['total']['live']['total_hours'], 2)
def test_reports_all_date_filter(self, get): get.return_value = load_response(200, 'fixtures/report_all_date.json') start = datetime.date(2013, 5, 13) end = datetime.date(2013, 5, 13) resp = self.zen.report.all(start_date=start, end_date=end) self.assertEquals(resp.code, 200) self.assertEquals(resp.body['statistics']['vod'][0]['encoded_minutes'], 5) self.assertEquals( resp.body['statistics']['vod'][0]['billable_minutes'], 0) self.assertEquals(resp.body['statistics']['live'][0]['stream_hours'], 1) self.assertEquals(resp.body['statistics']['live'][0]['total_hours'], 2) self.assertEquals(resp.body['total']['vod']['encoded_minutes'], 5) self.assertEquals(resp.body['total']['vod']['billable_minutes'], 0) self.assertEquals(resp.body['total']['live']['stream_hours'], 1) self.assertEquals(resp.body['total']['live']['total_hours'], 2)
def test_input_details(self, get): get.return_value = load_response(200, 'fixtures/input_details.json') resp = self.zen.input.details(15432) self.assertEquals(resp.code, 200) self.assertTrue(resp.body['id'] > 0)
def test_job_finish(self, put): put.return_value = load_response(204) resp = self.zen.job.finish(99999) self.assertEquals(resp.code, 204)
def test_account_live_authorized(self, put): put.return_value = load_response(204) resp = self.zen.account.live() self.assertEquals(resp.code, 204)
def test_output_progress(self, get): get.return_value = load_response(200, 'fixtures/output_progress.json') resp = self.zen.output.progress(123456) self.assertEquals(resp.code, 200) self.assertEquals(resp.body['state'], 'processing')
def test_job_resubmit(self, put): put.return_value = load_response(204) resp = self.zen.job.resubmit(5555) self.assertEquals(resp.code, 204) self.assertEquals(resp.body, None)
def test_output_details(self, get): get.return_value = load_response(200, 'fixtures/output_details.json') resp = self.zen.output.details(22222) self.assertEquals(resp.code, 200) self.assertTrue(resp.body['id'] > 0)
def test_job_list_limit(self, get): get.return_value = load_response(200, 'fixtures/job_list_limit.json') resp = self.zen.job.list(per_page=1) self.assertEquals(resp.code, 200) self.assertEquals(len(resp.body), 1)
def test_input_progress(self, get): get.return_value = load_response(200, 'fixtures/input_progress.json') resp = self.zen.input.progress(14325) self.assertEquals(resp.code, 200) self.assertEquals(resp.body['state'], 'processing')