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

Commit 9e1f6ba

Browse filesBrowse files
committed
add tests for setting the api version
1 parent c7c3c5c commit 9e1f6ba
Copy full SHA for 9e1f6ba

File tree

1 file changed

+16
-1
lines changed
Filter options

1 file changed

+16
-1
lines changed

‎test/test_zencoder.py

Copy file name to clipboardExpand all lines: test/test_zencoder.py
+16-1Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ def setUp(self):
99

1010
def test_api_key(self):
1111
""" initialize zencoder object and test api key """
12-
api_key = 'abcd123'
12+
api_key = 'testapikey'
1313
zc = Zencoder(api_key=api_key)
1414
self.assertEquals(zc.api_key, api_key)
1515

@@ -19,6 +19,21 @@ def test_api_key_env_var(self):
1919
zc = Zencoder()
2020
self.assertEquals(zc.api_key, 'abcd123')
2121

22+
def test_default_api_version(self):
23+
os.environ['ZENCODER_API_KEY'] = 'abcd123'
24+
zc = Zencoder()
25+
self.assertEquals(zc.base_url, 'https://app.zencoder.com/api/v2/')
26+
27+
def test_set_api_version(self):
28+
os.environ['ZENCODER_API_KEY'] = 'abcd123'
29+
zc = Zencoder(api_version='v1')
30+
self.assertEquals(zc.base_url, 'https://app.zencoder.com/api/v1/')
31+
32+
def test_set_api_edge_version(self):
33+
os.environ['ZENCODER_API_KEY'] = 'abcd123'
34+
zc = Zencoder(api_version='edge')
35+
self.assertEquals(zc.base_url, 'https://app.zencoder.com/api/')
36+
2237
if __name__ == "__main__":
2338
unittest.main()
2439

0 commit comments

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