-
Notifications
You must be signed in to change notification settings - Fork 721
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Doug Black
committed
May 19, 2017
1 parent
f4d2f6a
commit 12dc576
Showing
123 changed files
with
4,730 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# coding=utf-8 | ||
""" | ||
This code was generated by | ||
\ / _ _ _| _ _ | ||
| (_)\/(_)(_|\/| |(/_ v1.0.0 | ||
/ / | ||
""" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# coding=utf-8 | ||
""" | ||
This code was generated by | ||
\ / _ _ _| _ _ | ||
| (_)\/(_)(_|\/| |(/_ v1.0.0 | ||
/ / | ||
""" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# coding=utf-8 | ||
""" | ||
This code was generated by | ||
\ / _ _ _| _ _ | ||
| (_)\/(_)(_|\/| |(/_ v1.0.0 | ||
/ / | ||
""" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,140 @@ | ||
# coding=utf-8 | ||
""" | ||
This code was generated by | ||
\ / _ _ _| _ _ | ||
| (_)\/(_)(_|\/| |(/_ v1.0.0 | ||
/ / | ||
""" | ||
|
||
from tests import IntegrationTestCase | ||
from tests.holodeck import Request | ||
from twilio.base.exceptions import TwilioException | ||
from twilio.http.response import Response | ||
|
||
|
||
class RecordingTestCase(IntegrationTestCase): | ||
|
||
def test_fetch_request(self): | ||
self.holodeck.mock(Response(500, '')) | ||
|
||
with self.assertRaises(TwilioException): | ||
self.client.video.v1.rooms(sid="RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \ | ||
.recordings(sid="RTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").fetch() | ||
|
||
self.holodeck.assert_has_request(Request( | ||
'get', | ||
'https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/RTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', | ||
)) | ||
|
||
def test_fetch_response(self): | ||
self.holodeck.mock(Response( | ||
200, | ||
''' | ||
{ | ||
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", | ||
"status": "processing", | ||
"date_created": "2015-07-30T20:00:00Z", | ||
"sid": "RTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", | ||
"source_sid": "MTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", | ||
"size": 0, | ||
"type": "audio", | ||
"duration": 0, | ||
"container_format": "mka", | ||
"codec": "OPUS", | ||
"grouping_sids": { | ||
"room_sid": "RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" | ||
}, | ||
"room_sid": "RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", | ||
"url": "https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/RTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", | ||
"links": { | ||
"media": "https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/RTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media" | ||
} | ||
} | ||
''' | ||
)) | ||
|
||
actual = self.client.video.v1.rooms(sid="RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \ | ||
.recordings(sid="RTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").fetch() | ||
|
||
self.assertIsNotNone(actual) | ||
|
||
def test_list_request(self): | ||
self.holodeck.mock(Response(500, '')) | ||
|
||
with self.assertRaises(TwilioException): | ||
self.client.video.v1.rooms(sid="RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \ | ||
.recordings.list() | ||
|
||
self.holodeck.assert_has_request(Request( | ||
'get', | ||
'https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings', | ||
)) | ||
|
||
def test_read_empty_response(self): | ||
self.holodeck.mock(Response( | ||
200, | ||
''' | ||
{ | ||
"recordings": [], | ||
"meta": { | ||
"page": 0, | ||
"page_size": 50, | ||
"first_page_url": "https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings?PageSize=50&Page=0", | ||
"previous_page_url": null, | ||
"url": "https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings?PageSize=50&Page=0", | ||
"next_page_url": null, | ||
"key": "recordings" | ||
} | ||
} | ||
''' | ||
)) | ||
|
||
actual = self.client.video.v1.rooms(sid="RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \ | ||
.recordings.list() | ||
|
||
self.assertIsNotNone(actual) | ||
|
||
def test_read_results_response(self): | ||
self.holodeck.mock(Response( | ||
200, | ||
''' | ||
{ | ||
"recordings": [ | ||
{ | ||
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", | ||
"status": "completed", | ||
"date_created": "2015-07-30T20:00:00Z", | ||
"sid": "RTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", | ||
"source_sid": "MTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", | ||
"size": 0, | ||
"type": "audio", | ||
"duration": 0, | ||
"container_format": "mka", | ||
"codec": "OPUS", | ||
"grouping_sids": { | ||
"room_sid": "RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" | ||
}, | ||
"room_sid": "RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", | ||
"url": "https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/RTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", | ||
"links": { | ||
"media": "https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/RTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media" | ||
} | ||
} | ||
], | ||
"meta": { | ||
"page": 0, | ||
"page_size": 50, | ||
"first_page_url": "https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings?PageSize=50&Page=0", | ||
"previous_page_url": null, | ||
"url": "https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings?PageSize=50&Page=0", | ||
"next_page_url": null, | ||
"key": "recordings" | ||
} | ||
} | ||
''' | ||
)) | ||
|
||
actual = self.client.video.v1.rooms(sid="RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \ | ||
.recordings.list() | ||
|
||
self.assertIsNotNone(actual) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
# coding=utf-8 | ||
""" | ||
This code was generated by | ||
\ / _ _ _| _ _ | ||
| (_)\/(_)(_|\/| |(/_ v1.0.0 | ||
/ / | ||
""" | ||
|
||
from tests import IntegrationTestCase | ||
from tests.holodeck import Request | ||
from twilio.base.exceptions import TwilioException | ||
from twilio.http.response import Response | ||
|
||
|
||
class RecordingTestCase(IntegrationTestCase): | ||
|
||
def test_fetch_request(self): | ||
self.holodeck.mock(Response(500, '')) | ||
|
||
with self.assertRaises(TwilioException): | ||
self.client.video.v1.recordings(sid="RTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").fetch() | ||
|
||
self.holodeck.assert_has_request(Request( | ||
'get', | ||
'https://video.twilio.com/v1/Recordings/RTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', | ||
)) | ||
|
||
def test_fetch_response(self): | ||
self.holodeck.mock(Response( | ||
200, | ||
''' | ||
{ | ||
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", | ||
"status": "processing", | ||
"date_created": "2015-07-30T20:00:00Z", | ||
"sid": "RTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", | ||
"source_sid": "MTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", | ||
"size": 0, | ||
"url": "https://video.twilio.com/v1/Recordings/RTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", | ||
"type": "audio", | ||
"duration": 0, | ||
"container_format": "mka", | ||
"codec": "OPUS", | ||
"grouping_sids": { | ||
"room_sid": "RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" | ||
}, | ||
"links": { | ||
"media": "https://video.twilio.com/v1/Recordings/RTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media" | ||
} | ||
} | ||
''' | ||
)) | ||
|
||
actual = self.client.video.v1.recordings(sid="RTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").fetch() | ||
|
||
self.assertIsNotNone(actual) | ||
|
||
def test_list_request(self): | ||
self.holodeck.mock(Response(500, '')) | ||
|
||
with self.assertRaises(TwilioException): | ||
self.client.video.v1.recordings.list() | ||
|
||
self.holodeck.assert_has_request(Request( | ||
'get', | ||
'https://video.twilio.com/v1/Recordings', | ||
)) | ||
|
||
def test_read_empty_response(self): | ||
self.holodeck.mock(Response( | ||
200, | ||
''' | ||
{ | ||
"recordings": [], | ||
"meta": { | ||
"page": 0, | ||
"page_size": 50, | ||
"first_page_url": "https://video.twilio.com/v1/Recordings?PageSize=50&Page=0", | ||
"previous_page_url": null, | ||
"url": "https://video.twilio.com/v1/Recordings?PageSize=50&Page=0", | ||
"next_page_url": null, | ||
"key": "recordings" | ||
} | ||
} | ||
''' | ||
)) | ||
|
||
actual = self.client.video.v1.recordings.list() | ||
|
||
self.assertIsNotNone(actual) | ||
|
||
def test_delete_request(self): | ||
self.holodeck.mock(Response(500, '')) | ||
|
||
with self.assertRaises(TwilioException): | ||
self.client.video.v1.recordings(sid="RTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").delete() | ||
|
||
self.holodeck.assert_has_request(Request( | ||
'delete', | ||
'https://video.twilio.com/v1/Recordings/RTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', | ||
)) | ||
|
||
def test_delete_response(self): | ||
self.holodeck.mock(Response( | ||
204, | ||
None, | ||
)) | ||
|
||
actual = self.client.video.v1.recordings(sid="RTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").delete() | ||
|
||
self.assertTrue(actual) |
Oops, something went wrong.