8000 Regenerate · srikarth/twilio-python@5ea8570 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5ea8570

Browse files
author
Doug Black
committed
Regenerate
1 parent 1ffc6f4 commit 5ea8570

File tree

196 files changed

+14483
-99
lines changed

Some content is hidden

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

196 files changed

+14483
-99
lines changed

CHANGES.md

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

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

6+
[2017-05-22] Version 6.2.0-alpha-1
7+
----------------------------------
8+
9+
- Update usage record categories.
10+
- Add `get_page` method for reentrant paging.
11+
- Add video domain.
12+
- Add wireless domain.
13+
- Add fax domain.
14+
- Add sync domain.
15+
- Rename `Conversations` to `Sessions`.
16+
- Add `area_code_geomatch` to messaging `Service`.
17+
- Add `Exports` API to preview.
18+
619
[2017-05-12] Version 6.1.2-alpha-1
720
----------------------------------
821

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: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
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 FaxMediaTestCase(IntegrationTestCase):
16+
17+
def test_fetch_request(self):
18+
self.holodeck.mock(Response(500, ''))
19+
20+
with self.assertRaises(TwilioException):
21+
self.client.fax.v1.faxes(sid="FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
22+
.media(sid="MEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").fetch()
23+
24+
self.holodeck.assert_has_request(Request(
25+
'get',
26+
'https://fax.twilio.com/v1/Faxes/FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media/MEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
27+
))
28+
29+
def test_fetch_response(self):
30+
self.holodeck.mock(Response(
31+
200,
32+
'''
33+
{
34+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
35+
"content_type": "application/pdf",
36+< 10000 /span>
"date_created": "2015-07-30T20:00:00Z",
37+
"date_updated": "2015-07-30T20:00:00Z",
38+
"fax_sid": "FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
39+
"sid": "MEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
40+
"url": "https://fax.twilio.com/v1/Faxes/FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media/MEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
41+
}
42+
'''
43+
))
44+
45+
actual = self.client.fax.v1.faxes(sid="FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
46+
.media(sid="MEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").fetch()
47+
48+
self.assertIsNotNone(actual)
49+
50+
def test_list_request(self):
51+
self.holodeck.mock(Response(500, ''))
52+
53+
with self.assertRaises(TwilioException):
54+
self.client.fax.v1.faxes(sid="FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
55+
.media.list()
56+
57+
self.holodeck.assert_has_request(Request(
58+
'get',
59+
'https://fax.twilio.com/v1/Faxes/FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media',
60+
))
61+
62+
def test_read_response(self):
63+
self.holodeck.mock(Response(
64+
200,
65+
'''
66+
{
67+
"media": [
68+
{
69+
"sid": "MEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
70+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
71+
"fax_sid": "FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
72+
"content_type": "application/pdf",
73+
"date_created": "2015-07-30T20:00:00Z",
74+
"date_updated": "2015-07-30T20:00:00Z",
75+
"url": "https://fax.twilio.com/v1/Faxes/FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media/MEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
76+
}
77+
],
78+
"meta": {
79+
"first_page_url": "https://fax.twilio.com/v1/Faxes/FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media?PageSize=50&Page=0",
80+
"key": "media",
81+
"next_page_url": null,
82+
"page": 0,
83+
"page_size": 50,
84+
"previous_page_url": null,
85+
"url": "https://fax.twilio.com/v1/Faxes/FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media?PageSize=50&Page=0"
86+
}
87+
}
88+
'''
89+
))
90+
91+
actual = self.client.fax.v1.faxes(sid="FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
92+
.media.list()
93+
94+
self.assertIsNotNone(actual)
95+
96+
def test_delete_request(self):
97+
self.holodeck.mock(Response(500, ''))
98+
99+
with self.assertRaises(TwilioException):
100+
self.client.fax.v1.faxes(sid="FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
101+
.media(sid="MEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").delete()
102+
103+
self.holodeck.assert_has_request(Request(
104+
'delete',
105+
'https://fax.twilio.com/v1/Faxes/FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media/MEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
106+
))
107+
108+
def test_delete_response(self):
109+
self.holodeck.mock(Response(
110+
204,
111+
None,
112+
))
113+
114+
actual = self.client.fax.v1.faxes(sid="FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
115+
.media(sid="MEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").delete()
116+
117+
self.assertTrue(actual)

tests/integration/fax/v1/test_fax.py

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ def test_fetch_response(self):
3737
"direction": "outbound",
3838
"from": "+14155551234",
3939
"media_url": "https://www.example.com/fax.pdf",
40+
"media_sid": "MEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
4041
"num_pages": null,
4142
"price": null,
4243
"price_unit": null,
@@ -45,6 +46,9 @@ def test_fetch_response(self):
4546
"status": "queued",
4647
"to": "+14155554321",
4748
"duration": null,
49+
"links": {
50+
"media": "https://fax.twilio.com/v1/Faxes/FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media"
51+
},
4852
"url": "https://fax.twilio.com/v1/Faxes/FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
4953
}
5054
'''
@@ -102,6 +106,7 @@ def test_read_full_response(self):
102106
"direction": "outbound",
103107
"from": "+14155551234",
104108
"media_url": "https://www.example.com/fax.pdf",
109+
"media_sid": "MEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
105110
"num_pages": null,
106111
"price": null,
107112
"price_unit": null,
@@ -110,6 +115,9 @@ def test_read_full_response(self):
110115
"status": "queued",
111116
"to": "+14155554321",
112117
"duration": null,
118+
"links": {
119+
"media": "https://fax.twilio.com/v1/Faxes/FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media"
120+
},
113121
"url": "https://fax.twilio.com/v1/Faxes/FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
114122
}
115123
],
@@ -134,10 +142,9 @@ def test_create_request(self):
134142
self.holodeck.mock(Response(500, ''))
135143

136144
with self.assertRaises(TwilioException):
137-
self.client.fax.v1.faxes.create(from_="from_", to="to", media_url="https://example.com")
145+
self.client.fax.v1.faxes.create(to="to", media_url="https://example.com")
138146

139147
values = {
140-
'From': "from_",
141148
'To': "to",
142149
'MediaUrl': "https://example.com",
143150
}
@@ -160,6 +167,7 @@ def test_create_response(self):
160167
"direction": "outbound",
161168
"from": "+14155551234",
162169
"media_url": null,
170+
"media_sid": null,
163171
"num_pages": null,
164172
"price": null,
165173
"price_unit": null,
@@ -168,12 +176,15 @@ def test_create_response(self):
168176
"status": "queued",
169177
"to": "+14155554321",
170178
"duration": null,
179+
"links": {
180+
"media": "https://fax.twilio.com/v1/Faxes/FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media"
181+
},
171182
"url": "https://fax.twilio.com/v1/Faxes/FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
172183
}
173184
'''
174185
))
175186

176-
actual = self.client.fax.v1.faxes.create(from_="from_", to="to", media_url="https://example.com")
187+
actual = self.client.fax.v1.faxes.create(to="to", media_url="https://example.com")
177188

178189
self.assertIsNotNone(actual)
179190

@@ -200,6 +211,7 @@ def test_update_response(self):
200211
"direction": "outbound",
201212
"from": "+14155551234",
202213
"media_url": null,
214+
"media_sid": null,
203215
"num_pages": null,
204216
"price": null,
205217
"price_unit": null,
@@ -208,6 +220,9 @@ def test_update_response(self):
208220
"status": "canceled",
209221
"to": "+14155554321",
210222
"duration": null,
223+
"links": {
224+
"media": "https://fax.twilio.com/v1/Faxes/FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media"
225+
},
211226
"url": "https://fax.twilio.com/v1/Faxes/FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
212227
}
213228
'''
@@ -216,3 +231,24 @@ def test_update_response(self):
216231
actual = self.client.fax.v1.faxes(sid="FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").update()
217232

218233
self.assertIsNotNone(actual)
234+
235+
def test_delete_request(self):
236+
self.holodeck.mock(Response(500, ''))
237+
238+
with self.assertRaises(TwilioException):
239+
self.client.fax.v1.faxes(sid="FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").delete()
240+
241+
self.holodeck.assert_has_request(Request(
242+
'delete',
243+
'https://fax.twilio.com/v1/Faxes/FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
244+
))
245+
246+
def test_delete_response(self):
247+
self.holodeck.mock(Response(
248+
204,
249+
None,
250+
))
251+
252+
actual = self.client.fax.v1.faxes(sid="FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").delete()
253+
254+
self.assertTrue(actual)

tests/integration/messaging/v1/test_service.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ def test_create_response(self):
4848
"sticky_sender": true,
4949
"smart_encoding": false,
5050
"mms_converter": true,
51+
"fallback_to_long_code": true,
52+
"scan_message_content": "inherit",
53+
"area_code_geomatch": true,
54+
"validity_period": 600,
5155
"links": {
5256
"phone_numbers": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PhoneNumbers",
5357
"short_codes": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ShortCodes",
@@ -86,6 +90,10 @@ def test_update_response(self):
8690
"sticky_sender": false,
8791
"mms_converter": true,
8892
"smart_encoding": false,
93+
"fallback_to_long_code": true,
94+
"scan_message_content": "inherit",
95+
"area_code_geomatch": true,
96+
"validity_period": 600,
8997
"inbound_request_url": "https://www.example.com",
9098
"inbound_method": "POST",
9199
"fallback_url": null,
@@ -140,6 +148,10 @@ def test_read_full_response(self):
140148
"sticky_sender": true,
141149
"mms_converter": true,
142150
"smart_encoding": false,
151+
"fallback_to_long_code": true,
152+
"area_code_geomatch": true,
153+
"validity_period": 600,
154+
"scan_message_content": "inherit",
143155
"inbound_request_url": "https://www.example.com/",
144156
"inbound_method": "POST",
145157
"fallback_url": null,
@@ -190,6 +202,10 @@ def test_fetch_response(self):
190202
"sticky_sender": true,
191203
"mms_converter": true,
192204
"smart_encoding": false,
205+
"fallback_to_long_code": true,
206+
"area_code_geomatch": true,
207+
"validity_period": 600,
208+
"scan_message_content": "inherit",
193209
"links": {
194210
"phone_numbers": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PhoneNumbers",
195211
"short_codes": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ShortCodes",

tests/integration/preview/sync/service/sync_list/test_sync_list_item.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
from tests import IntegrationTestCase
1010
from tests.holodeck import Request
11+
from twilio.base import serialize
1112
from twilio.base.exceptions import TwilioException
1213
from twilio.http.response import Response
1314

@@ -86,7 +87,7 @@ def test_create_request(self):
8687
.sync_list_items.create(data="{}")
8788

8889
values = {
89-
'Data': "{}",
90+
'Data': serialize.object("{}"),
9091
}
9192

9293
self.holodeck.assert_has_request(Request(
@@ -205,7 +206,7 @@ def test_update_request(self):
205206
.sync_list_items(index=1).update(data="{}")
206207

207208
values = {
208-
'Data': "{}",
209+
'Data': serialize.object("{}"),
209210
}
210211

211212
self.holodeck.assert_has_request(Request(

tests/integration/preview/sync/service/sync_map/test_sync_map_item.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
from tests import IntegrationTestCase
1010
from tests.holodeck import Request
11+
from twilio.base import serialize
1112
from twilio.base.exceptions import TwilioException
1213
from twilio.http.response import Response
1314

@@ -87,7 +88,7 @@ def test_create_request(self):
8788

8889
values = {
8990
'Key': "key",
90-
'Data': "{}",
91+
'Data': serialize.object("{}"),
9192
}
9293

9394
self.holodeck.assert_has_request(Request(
@@ -206,7 +207,7 @@ def test_update_request(self):
206207
.sync_map_items(key="key").update(data="{}")
207208

208209
values = {
209-
'Data': "{}",
210+
'Data': serialize.object("{}"),
210211
}
211212

212213
self.holodeck.assert_has_request(Request(

tests/integration/preview/sync/service/test_document.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
from tests import IntegrationTestCase
1010
from tests.holodeck import Request
11+
from twilio.base import serialize
1112
from twilio.base.exceptions import TwilioException
1213
from twilio.http.response import Response
1314

@@ -199,7 +200,7 @@ def test_update_request(self):
199200
.documents(sid="ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").update(data="{}")
200201

201202
values = {
202-
'Data': "{}",
203+
'Data': serialize.object("{}"),
203204
}
204205

205206
self.holodeck.assert_has_request(Request(

0 commit comments

Comments
 (0)
0