Skip to content

Commit 10bf594

Browse files
author
Doug Black
committed
Regenerate
1 parent 96a35dd commit 10bf594

23 files changed

+5924
-0
lines changed
Lines changed: 198 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,198 @@
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 AuthorizationDocumentTestCase(IntegrationTestCase):
16+
17+
def test_fetch_request(self):
18+
self.holodeck.mock(Response(500, ''))
19+
20+
with self.assertRaises(TwilioException):
21+
self.client.preview.hosted_numbers.authorization_documents(sid="PXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").fetch()
22+
23+
self.holodeck.assert_has_request(Request(
24+
'get',
25+
'https://preview.twilio.com/HostedNumbers/AuthorizationDocuments/PXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
26+
))
27+
28+
def test_fetch_response(self):
29+
self.holodeck.mock(Response(
30+
200,
31+
'''
32+
{
33+
"address_sid": "AD11111111111111111111111111111111",
34+
"cc_emails": [
35+
"aaa@twilio.com",
36+
"bbb@twilio.com"
37+
],
38+
"date_created": "2017-03-28T20:06:39Z",
39+
"date_updated": "2017-03-28T20:06:39Z",
40+
"email": "test@twilio.com",
41+
"sid": "PXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
42+
"status": "signing",
43+
"url": "https://preview.twilio.com/HostedNumbers/AuthorizationDocuments/PXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
44+
}
45+
'''
46+
))
47+
48+
actual = self.client.preview.hosted_numbers.authorization_documents(sid="PXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").fetch()
49+
50+
self.assertIsNotNone(actual)
51+
52+
def test_update_request(self):
53+
self.holodeck.mock(Response(500, ''))
54+
55+
with self.assertRaises(TwilioException):
56+
self.client.preview.hosted_numbers.authorization_documents(sid="PXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").update()
57+
58+
self.holodeck.assert_has_request(Request(
59+
'post',
60+
'https://preview.twilio.com/HostedNumbers/AuthorizationDocuments/PXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
61+
))
62+
63+
def test_update_response(self):
64+
self.holodeck.mock(Response(
65+
200,
66+
'''
67+
{
68+
"address_sid": "ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
69+
"cc_emails": [
70+
"test1@twilio.com",
71+
"test2@twilio.com"
72+
],
73+
"date_created": "2017-03-28T20:06:39Z",
74+
"date_updated": "2017-03-28T20:06:39Z",
75+
"email": "test+hosted@twilio.com",
76+
"sid": "PXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
77+
"status": "signing",
78+
"url": "https://preview.twilio.com/HostedNumbers/AuthorizationDocuments/PXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
79+
}
80+
'''
81+
))
82+
83+
actual = self.client.preview.hosted_numbers.authorization_documents(sid="PXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").update()
84+
85+
self.assertIsNotNone(actual)
86+
87+
def test_list_request(self):
88+
self.holodeck.mock(Response(500, ''))
89+
90+
with self.assertRaises(TwilioException):
91+
self.client.preview.hosted_numbers.authorization_documents.list()
92+
93+
self.holodeck.assert_has_request(Request(
94+
'get',
95+
'https://preview.twilio.com/HostedNumbers/AuthorizationDocuments',
96+
))
97+
98+
def test_read_empty_response(self):
99+
self.holodeck.mock(Response(
100+
200,
101+
'''
102+
{
103+
"meta": {
104+
"first_page_url": "https://preview.twilio.com/HostedNumbers/AuthorizationDocuments?PageSize=50&Page=0",
105+
"key": "items",
106+
"next_page_url": null,
107+
"page": 0,
108+
"page_size": 50,
109+
"previous_page_url": null,
110+
"url": "https://preview.twilio.com/HostedNumbers/AuthorizationDocuments?PageSize=50&Page=0"
111+
},
112+
"items": []
113+
}
114+
'''
115+
))
116+
117+
actual = self.client.preview.hosted_numbers.authorization_documents.list()
118+
119+
self.assertIsNotNone(actual)
120+
121+
def test_read_full_response(self):
122+
self.holodeck.mock(Response(
123+
200,
124+
'''
125+
{
126+
"meta": {
127+
"first_page_url": "https://preview.twilio.com/HostedNumbers/AuthorizationDocuments?PageSize=50&Page=0",
128+
"key": "items",
129+
"next_page_url": null,
130+
"page": 0,
131+
"page_size": 50,
132+
"previous_page_url": null,
133+
"url": "https://preview.twilio.com/HostedNumbers/AuthorizationDocuments?PageSize=50&Page=0"
134+
},
135+
"items": [
136+
{
137+
"address_sid": "ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
138+
"cc_emails": [
139+
"test1@twilio.com",
140+
"test2@twilio.com"
141+
],
142+
"date_created": "2017-03-28T20:06:39Z",
143+
"date_updated": "2017-03-28T20:06:39Z",
144+
"email": "test+hosted@twilio.com",
145+
"sid": "PXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
146+
"status": "signing",
147+
"url": "https://preview.twilio.com/HostedNumbers/AuthorizationDocuments/PXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
148+
}
149+
]
150+
}
151+
'''
152+
))
153+
154+
actual = self.client.preview.hosted_numbers.authorization_documents.list()
155+
156+
self.assertIsNotNone(actual)
157+
158+
def test_create_request(self):
159+
self.holodeck.mock(Response(500, ''))
160+
161+
with self.assertRaises(TwilioException):
162+
self.client.preview.hosted_numbers.authorization_documents.create(hosted_number_order_sids=['hosted_number_order_sids'], address_sid="ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", email="email")
163+
164+
values = {
165+
'HostedNumberOrderSids': ['hosted_number_order_sids'],
166+
'AddressSid': "ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
167+
'Email': "email",
168+
}
169+
170+
self.holodeck.assert_has_request(Request(
171+
'post',
172+
'https://preview.twilio.com/HostedNumbers/AuthorizationDocuments',
173+
data=values,
174+
))
175+
176+
def test_create_response(self):
177+
self.holodeck.mock(Response(
178+
201,
179+
'''
180+
{
181+
"address_sid": "ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
182+
"cc_emails": [
183+
"test1@twilio.com",
184+
"test2@twilio.com"
185+
],
186+
"date_created": "2017-03-28T20:06:39Z",
187+
"date_updated": "2017-03-28T20:06:39Z",
188+
"email": "test+hosted@twilio.com",
189+
"sid": "PXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
190+
"status": "signing",
191+
"url": "https://preview.twilio.com/HostedNumbers/AuthorizationDocuments/PXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
192+
}
193+
'''
194+
))
195+
196+
actual = self.client.preview.hosted_numbers.authorization_documents.create(hosted_number_order_sids=['hosted_number_order_sids'], address_sid="ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", email="email")
197+
198+
self.assertIsNotNone(actual)

tests/integration/proxy/__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: 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: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
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 MessageInteractionTestCase(IntegrationTestCase):
16+
17+
def test_create_request(self):
18+
self.holodeck.mock(Response(500, ''))
19+
20+
with self.assertRaises(TwilioException):
21+
self.client.proxy.v1.services(sid="KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
22+
.sessions(sid="KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
23+
.participants(sid="KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
24+
.message_interactions.create()
25+
26+
self.holodeck.assert_has_request(Request(
27+
'post',
28+
'https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/MessageInteractions',
29+
))
30+
31+
def test_create_response(self):
32+
self.holodeck.mock(Response(
33+
201,
34+
'''
35+
{
36+
"service_sid": "KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
37+
"data": "body",
38+
"date_created": "2015-07-30T20:00:00Z",
39+
"date_updated": "2015-07-30T20:00:00Z",
40+
"participant_sid": "KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
41+
"inbound_participant_sid": null,
42+
"inbound_resource_sid": null,
43+
"inbound_resource_status": null,
44+
"inbound_resource_type": null,
45+
"inbound_resource_url": null,
46+
"outbound_participant_sid": "KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
47+
"outbound_resource_sid": "SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
48+
"outbound_resource_status": "sent",
49+
"outbound_resource_type": "Message",
50+
"outbound_resource_url": null,
51+
"sid": "KIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
52+
"type": "message",
53+
"url": "https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/MessageInteractions/KIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
54+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
55+
"session_sid": "KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
56+
}
57+
'''
58+
))
59+
60+
actual = self.client.proxy.v1.services(sid="KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
61+
.sessions(sid="KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
62+
.participants(sid="KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
63+
.message_interactions.create()
64+
65+
self.assertIsNotNone(actual)
66+
67+
def test_fetch_request(self):
68+
self.holodeck.mock(Response(500, ''))
69+
70+
with self.assertRaises(TwilioException):
71+
self.client.proxy.v1.services(sid="KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
72+
.sessions(sid="KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
73+
.participants(sid="KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
74+
.message_interactions(sid="KIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").fetch()
75+
76+
self.holodeck.assert_has_request(Request(
77+
'get',
78+
'https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/MessageInteractions/KIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
79+
))
80+
81+
def test_fetch_response(self):
82+
self.holodeck.mock(Response(
83+
200,
84+
'''
85+
{
86+
"service_sid": "KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
87+
"data": "data",
88+
"date_created": "2015-07-30T20:00:00Z",
89+
"date_updated": "2015-07-30T20:00:00Z",
90+
"participant_sid": "KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
91+
"inbound_participant_sid": null,
92+
"inbound_resource_sid": null,
93+
"inbound_resource_status": null,
94+
"inbound_resource_type": null,
95+
"inbound_resource_url": null,
96+
"outbound_participant_sid": "KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
97+
"outbound_resource_sid": "SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
98+
"outbound_resource_status": "sent",
99+
"outbound_resource_type": "Message",
100+
"outbound_resource_url": null,
101+
"sid": "KIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
102+
"type": "message",
103+
"url": "https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/MessageInteractions/KIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
104+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
105+
"session_sid": "KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
106+
}
107+
'''
108+
))
109+
110+
actual = self.client.proxy.v1.services(sid="KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
111+
.sessions(sid="KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
112+
.participants(sid="KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
113+
.message_interactions(sid="KIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").fetch()
114+
115+
self.assertIsNotNone(actual)
116+
117+
def test_list_request(self):
118+
self.holodeck.mock(Response(500, ''))
119+
120+
with self.assertRaises(TwilioException):
121+
self.client.proxy.v1.services(sid="KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
122+
.sessions(sid="KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
123+
.participants(sid="KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
124+
.message_interactions.list()
125+
126+
self.holodeck.assert_has_request(Request(
127+
'get',
128+
'https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/MessageInteractions',
129+
))
130+
131+
def test_read_empty_response(self):
132+
self.holodeck.mock(Response(
133+
200,
134+
'''
135+
{
136+
"interactions": [],
137+
"meta": {
138+
"previous_page_url": null,
139+
"next_page_url": null,
140+
"url": "https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/MessageInteractions?PageSize=50&Page=0",
141+
"page": 0,
142+
"first_page_url": "https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/MessageInteractions?PageSize=50&Page=0",
143+
"page_size": 50,
144+
"key": "interactions"
145+
}
146+
}
147+
'''
148+
))
149+
150+
actual = self.client.proxy.v1.services(sid="KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
151+
.sessions(sid="KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
152+
.participants(sid="KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
153+
.message_interactions.list()
154+
155+
self.assertIsNotNone(actual)

0 commit comments

Comments
 (0)