Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Add Inputs support #19

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 22, 2013
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add tests for inputs
  • Loading branch information
Alex Schworer committed May 22, 2013
commit f79ff4109257d6e7de6fbe8e20557df5d305d794
20 changes: 20 additions & 0 deletions 20 test/fixtures/input_details.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"audio_sample_rate": 44100,
"frame_rate": 30,
"job_id": 45497494,
"channels": "2",
"audio_bitrate_in_kbps": 50,
"height": 720,
"audio_codec": "aac",
"duration_in_ms": 5067,
"url": "http://s3.amazonaws.com/zencodertesting/test.mov",
"file_size_in_bytes": 922620,
"width": 1280,
"format": "mpeg4",
"state": "finished",
"total_bitrate_in_kbps": 1452,
"video_bitrate_in_kbps": 1402,
"id": 45475483,
"video_codec": "h264",
"privacy": false
}
6 changes: 6 additions & 0 deletions 6 test/fixtures/input_progress.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"state": "processing",
"current_event": "Downloading",
"current_event_progress": "32.34567345",
"progress": "45.2353255"
}
31 changes: 31 additions & 0 deletions 31 test/test_inputs.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import unittest
from zencoder import Zencoder

from mock import patch

from test_util import TEST_API_KEY, load_response
from zencoder import Zencoder

class TestInputs(unittest.TestCase):
def setUp(self):
self.zen = Zencoder(api_key=TEST_API_KEY)

@patch("requests.Session.get")
def test_input_details(self, get):
get.return_value = load_response(200, 'fixtures/input_details.json')

resp = self.zen.output.details(15432)
self.assertEquals(resp.code, 200)
self.assertTrue(resp.body['id'] > 0)

@patch("requests.Session.get")
def test_input_progress(self, get):
get.return_value = load_response(200, 'fixtures/input_progress.json')

resp = self.zen.output.progress(14325)
self.assertEquals(resp.code, 200)
self.assertEquals(resp.body['state'], 'processing')

if __name__ == "__main__":
unittest.main()

Morty Proxy This is a proxified and sanitized view of the page, visit original site.