Skip to content

Commit 1718b7d

Browse files
committed
Namespace docstrings
1 parent 1fcd2c6 commit 1718b7d

File tree

367 files changed

+27191
-10212
lines changed

Some content is hidden

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

367 files changed

+27191
-10212
lines changed

tests/integration/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
This code was generated by
44
\ / _ _ _| _ _
55
| (_)\/(_)(_|\/| |(/_ v1.0.0
6-
/ /
6+
/ /
77
"""
88

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: 208 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,208 @@
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.exceptions import TwilioException
12+
from twilio.http.response import Response
13+
14+
15+
class PublicKeyTestCase(IntegrationTestCase):
16+
17+
def test_list_request(self):
18+
self.holodeck.mock(Response(500, ''))
19+
20+
with self.assertRaises(TwilioException):
21+
self.client.accounts.v1.credentials \
22+
.public_key.list()
23+
24+
self.holodeck.assert_has_request(Request(
25+
'get',
26+
'https://accounts.twilio.com/v1/Credentials/PublicKeys',
27+
))
28+
29+
def test_read_empty_response(self):
30+
self.holodeck.mock(Response(
31+
200,
32+
'''
33+
{
34+
"credentials": [],
35+
"meta": {
36+
"first_page_url": "https://accounts.twilio.com/v1/Credentials/PublicKeys?PageSize=50&Page=0",
37+
"key": "credentials",
38+
"next_page_url": null,
39+
"page": 0,
40+
"page_size": 50,
41+
"previous_page_url": null,
42+
"url": "https://accounts.twilio.com/v1/Credentials/PublicKeys?PageSize=50&Page=0"
43+
}
44+
}
45+
'''
46+
))
47+
48+
actual = self.client.accounts.v1.credentials \
49+
.public_key.list()
50+
51+
self.assertIsNotNone(actual)
52+
53+
def test_read_full_response(self):
54+
self.holodeck.mock(Response(
55+
200,
56+
'''
57+
{
58+
"credentials": [
59+
{
60+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
61+
"date_created": "2015-07-31T04:00:00Z",
62+
"date_updated": "2015-07-31T04:00:00Z",
63+
"friendly_name": "friendly_name",
64+
"sid": "CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
65+
"url": "https://accounts.twilio.com/v1/Credentials/PublicKeys/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
66+
}
67+
],
68+
"meta": {
69+
"first_page_url": "https://accounts.twilio.com/v1/Credentials/PublicKeys?PageSize=50&Page=0",
70+
"key": "credentials",
71+
"next_page_url": null,
72+
"page": 0,
73+
"page_size": 50,
74+
"previous_page_url": null,
75+
"url": "https://accounts.twilio.com/v1/Credentials/PublicKeys?PageSize=50&Page=0"
76+
}
77+
}
78+
'''
79+
))
80+
81+
actual = self.client.accounts.v1.credentials \
82+
.public_key.list()
83+
84+
self.assertIsNotNone(actual)
85+
86+
def test_create_request(self):
87+
self.holodeck.mock(Response(500, ''))
88+
89+
with self.assertRaises(TwilioException):
90+
self.client.accounts.v1.credentials \
91+
.public_key.create(public_key="publickey")
92+
93+
values = {
94+
'PublicKey': "publickey",
95+
}
96+
97+
self.holodeck.assert_has_request(Request(
98+
'post',
99+
'https://accounts.twilio.com/v1/Credentials/PublicKeys',
100+
data=values,
101+
))
102+
103+
def test_create_response(self):
104+
self.holodeck.mock(Response(
105+
201,
106+
'''
107+
{
108+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
109+
"date_created": "2015-07-31T04:00:00Z",
110+
"date_updated": "2015-07-31T04:00:00Z",
111+
"friendly_name": "friendly_name",
112+
"sid": "CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
113+
"url": "https://accounts.twilio.com/v1/Credentials/PublicKeys/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
114+
}
115+
'''
116+
))
117+
118+
actual = self.client.accounts.v1.credentials \
119+
.public_key.create(public_key="publickey")
120+
121+
self.assertIsNotNone(actual)
122+
123+
def test_fetch_request(self):
124+
self.holodeck.mock(Response(500, ''))
125+
126+
with self.assertRaises(TwilioException):
127+
self.client.accounts.v1.credentials \
128+
.public_key(sid="CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").fetch()
129+
130+
self.holodeck.assert_has_request(Request(
131+
'get',
132+
'https://accounts.twilio.com/v1/Credentials/PublicKeys/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
133+
))
134+
135+
def test_fetch_response(self):
136+
self.holodeck.mock(Response(
137+
200,
138+
'''
139+
{
140+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
141+
"date_created": "2015-07-31T04:00:00Z",
142+
"date_updated": "2015-07-31T04:00:00Z",
143+
"friendly_name": "friendly_name",
144+
"sid": "CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
145+
"url": "https://accounts.twilio.com/v1/Credentials/PublicKeys/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
146+
}
147+
'''
148+
))
149+
150+
actual = self.client.accounts.v1.credentials \
151+
.public_key(sid="CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").fetch()
152+
153+
self.assertIsNotNone(actual)
154+
155+
def test_update_request(self):
156+
self.holodeck.mock(Response(500, ''))
157+
158+
with self.assertRaises(TwilioException):
159+
self.client.accounts.v1.credentials \
160+
.public_key(sid="CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").update()
161+
162+
self.holodeck.assert_has_request(Request(
163+
'post',
164+
'https://accounts.twilio.com/v1/Credentials/PublicKeys/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
165+
))
166+
167+
def test_update_response(self):
168+
self.holodeck.mock(Response(
169+
200,
170+
'''
171+
{
172+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
173+
"date_created": "2015-07-31T04:00:00Z",
174+
"date_updated": "2015-07-31T04:00:00Z",
175+
"friendly_name": "friendly_name",
176+
"sid": "CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
177+
"url": "https://accounts.twilio.com/v1/Credentials/PublicKeys/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
178+
}
179+
'''
180+
))
181+
182+
actual = self.client.accounts.v1.credentials \
183+
.public_key(sid="CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").update()
184+
185+
self.assertIsNotNone(actual)
186+
187+
def test_delete_request(self):
188+
self.holodeck.mock(Response(500, ''))
189+
190+
with self.assertRaises(TwilioException):
191+
self.client.accounts.v1.credentials \
192+
.public_key(sid="CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").delete()
193+
194+
self.holodeck.assert_has_request(Request(
195+
'delete',
196+
'https://accounts.twilio.com/v1/Credentials/PublicKeys/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
197+
))
198+
199+
def test_delete_response(self):
200+
self.holodeck.mock(Response(
201+
204,
202+
None,
203+
))
204+
205+
actual = self.client.accounts.v1.credentials \
206+
.public_key(sid="CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").delete()
207+
208+
self.assertTrue(actual)
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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.exceptions import TwilioException
12+
from twilio.http.response import Response
13+
14+
15+
class CredentialTestCase(IntegrationTestCase):
16+
pass

tests/integration/api/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
This code was generated by
44
\ / _ _ _| _ _
55
| (_)\/(_)(_|\/| |(/_ v1.0.0
6-
/ /
6+
/ /
77
"""
88

tests/integration/api/v2010/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
This code was generated by
44
\ / _ _ _| _ _
55
| (_)\/(_)(_|\/| |(/_ v1.0.0
6-
/ /
6+
/ /
77
"""
88

tests/integration/api/v2010/account/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
This code was generated by
44
\ / _ _ _| _ _
55
| (_)\/(_)(_|\/| |(/_ v1.0.0
6-
/ /
6+
/ /
77
"""
88

tests/integration/api/v2010/account/address/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
This code was generated by
44
\ / _ _ _| _ _
55
| (_)\/(_)(_|\/| |(/_ v1.0.0
6-
/ /
6+
/ /
77
"""
88

0 commit comments

Comments
 (0)