8000 Release 6.2.0 · codegician/twilio-python@12dc576 · GitHub
[go: up one dir, main page]

Skip to content
< 8000 header class="HeaderMktg header-logged-out js-details-container js-header Details f4 py-3" role="banner" data-is-top="true" data-color-mode=light data-light-theme=light data-dark-theme=dark>

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 12dc576

Browse files
author
Doug Black
committed
Release 6.2.0
1 parent f4d2f6a commit 12dc576

File tree

123 files changed

+4730
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

123 files changed

+4730
-1
lines changed

CHANGES.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@ twilio-python Changelog
33

44
Here you can see the full list of changes between each twilio-python release.
55

6+
[2017-05-19] Version 6.2.0
7+
--------------------------
8+
9+
- Add video domain.
10+
- Update usage record categories.
11+
- Add `get_page` method for reentrant paging.
12+
613
[2017-05-12] Version 6.1.2
714
----------------------------------
815

tests/integration/video/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# coding=utf-8
2+
"""
3+
This code was generated by
4+
\ / _ _ _| _ _
5+
| (_)\/(_)(_|\/| |(/_ v1.0.0
6+
/ /
7+
"""
8+
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# coding=utf-8
2+
"""
3+
This code was generated by
4+
\ / _ _ _| _ _
5+
| (_)\/(_)(_|\/| |(/_ v1.0.0
6+
/ /
7+
"""
8+
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# coding=utf-8
2+
"""
3+
This code was generated by
4+
\ / _ _ _| _ _
5+
| (_)\/(_)(_|\/| |(/_ v1.0.0
6+
/ /
7+
"""
8+
Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
# coding=utf-8
2+
"""
3+
This code was generated by
4+
\ / _ _ _| _ _
5+
| (_)\/(_)(_|\/| |(/_ v1.0.0
6+
/ /
7+
"""
8+
9+
from tests import IntegrationTestCase
10+
from tests.holodeck import Request
11+
from twilio.base.exceptions import TwilioException
12+
from twilio.http.response import Response
13+
14+
15+
class RecordingTestCase(IntegrationTestCase):
16+
17+
def test_fetch_request(self):
18+
self.holodeck.mock(Response(500, ''))
19+
20+
with self.assertRaises(TwilioException):
21+
self.client.video.v1.rooms(sid="RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
22+
.recordings(sid="RTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").fetch()
23+
24+
self.holodeck.assert_has_request(Request(
25+
'get',
26+
'https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/RTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
27+
))
28+
29+
def test_fetch_response(self):
30+
self.holodeck.mock(Response(
31+
200,
32+
'''
33+
{
34+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
35+
"status": "processing",
36+
"date_created": "2015-07-30T20:00:00Z",
37+
"sid": "RTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
38+
"source_sid": "MTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
39+
"size": 0,
40+
"type": "audio",
41+
"duration": 0,
42+
"container_format": "mka",
43+
"codec": "OPUS",
44+
"grouping_sids": {
45+
"room_sid": "RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
46+
},
47+
"room_sid": "RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
48+
"url": "https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/RTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
49+
"links": {
50+
"media": "https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/RTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media"
51+
}
52+
}
53+
'''
54+
))
55+
56+
actual = self.client.video.v1.rooms(sid="RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
57+
.recordings(sid="RTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").fetch()
58+
59+
self.assertIsNotNone(actual)
60+
61+
def test_list_request(self):
62+
self.holodeck.mock(Response(500, ''))
63+
64+
with self.assertRaises(TwilioException):
65+
self.client.video.v1.rooms(sid="RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
66+
.recordings.list()
67+
68+
self.holodeck.assert_has_request(Request(
69+
'get',
70+
'https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings',
71+
))
72+
73+
def test_read_empty_response(self):
74+
self.holodeck.mock(Response(
75+
200,
76+
'''
77+
{
78+
"recordings": [],
79+
"meta": {
80+
"page": 0,
81+
"page_size": 50,
82+
"first_page_url": "https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings?PageSize=50&Page=0",
83+
"previous_page_url": null,
84+
"url": "https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings?PageSize=50&Page=0",
85+
"next_page_url": null,
86+
"key": "recordings"
87+
}
88+
}
89+
'''
90+
))
91+
92+
actual = self.client.video.v1.rooms(sid="RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
93+
.recordings.list()
94+
95+
self.assertIsNotNone(actual)
96+
97+
def test_read_results_response(self):
98+
self.holodeck.mock(Response(
99+
200,
100+
'''
101+
{
102+
"recordings": [
103+
{
104+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
105+
"status": "completed",
106+
"date_created": "2015-07-30T20:00:00Z",
107+
"sid": "RTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
108+
"source_sid": "MTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
109+
"size": 0,
110+
"type": "audio",
111+
"duration": 0,
112+
"container_format": "mka",
113+
"codec": "OPUS",
114+
"grouping_sids": {
115+
"room_sid": "RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
116+
},
117+
"room_sid": "RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
118+
"url": "https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/RTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
119+
"links": {
120+
"media": "https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/RTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media"
121+
}
122+
}
123+
],
124+
"meta": {
125+
"page": 0,
126+
"page_size": 50,
127+
"first_page_url": "https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings?PageSize=50&Page=0",
128+
"previous_page_url": null,
129+
"url": "https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings?PageSize=50&Page=0",
130+
"next_page_url": null,
131+
"key": "recordings"
132+
}
133+
}
134+
'''
135+
))
136+
137+
actual = self.client.video.v1.rooms(sid="RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
138+
.recordings.list()
139+
140+
self.assertIsNotNone(actual)
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
# coding=utf-8
2+
"""
3+
This code was generated by
4+
\ / _ _ _| _ _
5+
| (_)\/(_)(_|\/| |(/_ v1.0.0
6+
/ /
7+
"""
8+
9+
from tests import IntegrationTestCase
10+
from tests.holodeck import Request
11+
from twilio.base.exceptions import TwilioException
12+
from twilio.http.response import Response
13+
14+
15+
class RecordingTestCase(IntegrationTestCase):
16+
17+
def test_fetch_request(self):
18+
self.holodeck.mock(Response(500, ''))
19+
20+
with self.assertRaises(TwilioException):
21+
self.client.video.v1.recordings(sid="RTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").fetch()
22+
23+
self.holodeck.assert_has_request(Request(
24+
'get',
25+
'https://video.twilio.com/v1/Recordings/RTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
26+
))
27+
28+
def test_fetch_response(self):
29+
self.holodeck.mock(Response(
30+
200,
31+
'''
32+
{
33+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
34+
"status": "processing",
35+
"date_created": "2015-07-30T20:00:00Z",
36+
"sid": "RTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
37+
"source_sid": "MTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
38+
"size": 0,
39+
"url": "https://video.twilio.com/v1/Recordings/RTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
40+
"type": "audio",
41+
"duration": 0,
42+
"container_format": "mka",
43+
"codec": "OPUS",
44+
"grouping_sids": {
45+
"room_sid": "RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
46+
},
47+
"links": {
48+
"media": "https://video.twilio.com/v1/Recordings/RTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media"
49+
}
50+
}
51+
'''
52+
))
53+
54+
actual = self.client.video.v1.recordings(sid="RTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").fetch()
55+
56+
self.assertIsNotNone(actual)
57+
58+
def test_list_request(self):
59+
self.holodeck.mock(Response(500, ''))
60+
61+
with self.assertRaises(TwilioException):
62+
self.client.video.v1.recordings.list()
63+
64+
self.holodeck.assert_has_request(Request(
65+
'get',
66+
'https://video.twilio.com/v1/Recordings',
67+
))
68+
69+
def test_read_empty_response(self):
70+
self.holodeck.mock(Response(
71+
200,
72+
'''
73+
{
74+
"recordings": [],
75+
"meta": {
76+
"page": 0,
77+
"page_size": 50,
78+
"first_page_url": "https://video.twilio.com/v1/Recordings?PageSize=50&Page=0",
79+
"previous_page_url": null,
80+
"url": "https://video.twilio.com/v1/Recordings?PageSize=50&Page=0",
81+
"next_page_url": null,
82+
"key": "recordings"
83+
}
84+
}
85+
'''
86+
))
87+
88+
actual = self.client.video.v1.recordings.list()
89+
90+
self.assertIsNotNone(actual)
91+
92+
def test_delete_request(self):
93+
self.holodeck.mock(Response(500, ''))
94+
95+
with self.assertRaises(TwilioException):
96+
self.client.video.v1.recordings(sid="RTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").delete()
97+
98+
self.holodeck.assert_has_request(Request(
99+
'delete',
100+
'https://video.twilio.com/v1/Recordings/RTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
101+
))
102+
103+
def test_delete_response(self):
104+
self.holodeck.mock(Response(
105+
204,
106+
None,
107+
))
108+
109+
actual = self.client.video.v1.recordings(sid="RTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").delete()
110+
111+
self.assertTrue(actual)

0 commit comments

Comments
 (0)
0