-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #202 from plivo/VT-4174
VT-4174
- Loading branch information
Showing
12 changed files
with
173 additions
and
8 deletions.
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
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
# -*- coding: utf-8 -*- | ||
__version__ = '4.23.0' | ||
__version__ = '4.24.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
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
15 changes: 15 additions & 0 deletions
15
tests/resources/fixtures/recordingGetAddedFilterResponse.json
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,15 @@ | ||
{ | ||
"add_time":"2022-04-12 16:08:53.523657+05:30", | ||
"call_uuid":"f72eea2a-446b-4412-a17f-3b17083bd25a", | ||
"conference_name":"", | ||
"from_number":"+919768368717", | ||
"recording_duration_ms":"7560.00000", | ||
"recording_end_ms":"1649759930398.00000", | ||
"recording_format":"mp3", | ||
"recording_id":"d405c4eb-d562-4399-af32-6ff3c57fa55x", | ||
"recording_start_ms":"1649759922838.00000", | ||
"recording_type":"call", | ||
"recording_url":"https://media.plivo.com/v1/Account/MAZTCXYJFKZJK3N2Q3YT/Recording/d405c4eb-d562-4399-af32-6ff3c57fa559.mp3", | ||
"resource_uri":"/v1/Account/MAZTCXYJFKZJK3N2Q3YT/Recording/d405c4eb-d562-4399-af32-6ff3c57fa559/", | ||
"to_number":"sip:[email protected]" | ||
} |
57 changes: 57 additions & 0 deletions
57
tests/resources/fixtures/recordingListFromFilterResponse.json
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,57 @@ | ||
{ | ||
"api_id": "041a2d92-bf96-11ec-8d3a-0242ac110002", | ||
"meta": { | ||
"limit": 20, | ||
"next": null, | ||
"offset": 0, | ||
"previous": null, | ||
"total_count": 2 | ||
}, | ||
"objects": [ | ||
{ | ||
"add_time": "2022-04-12 16:08:53.523657+05:30", | ||
"call_uuid": "f72eea2a-446b-4412-a17f-3b17083bd25a", | ||
"conference_name": "", | ||
"from_number": "+919768368717", | ||
"recording_duration_ms": "7560.00000", | ||
"recording_end_ms": "1649759930398.00000", | ||
"recording_format": "mp3", | ||
"recording_id": "d405c4eb-d562-4399-af32-6ff3c57fa559", | ||
"recording_start_ms": "1649759922838.00000", | ||
"recording_type": "call", | ||
"recording_url": "https://media.plivo.com/v1/Account/MAZTCXYJFKZJK3N2Q3YT/Recording/d405c4eb-d562-4399-af32-6ff3c57fa559.mp3", | ||
"resource_uri": "/v1/Account/MAZTCXYJFKZJK3N2Q3YT/Recording/d405c4eb-d562-4399-af32-6ff3c57fa559/", | ||
"to_number": "sip:[email protected]" | ||
}, | ||
{ | ||
"add_time": "2022-04-12 13:49:19.579419+05:30", | ||
"call_uuid": "b5e575b4-721c-425d-8da5-6c5cf6494487", | ||
"conference_name": "", | ||
"from_number": "+919768368712", | ||
"recording_duration_ms": "25020.00000", | ||
"recording_end_ms": "1649751556401.00000", | ||
"recording_format": "mp3", | ||
"recording_id": "7ed2395e-e08a-4448-86b1-9770331d94f3", | ||
"recording_start_ms": "1649751531381.00000", | ||
"recording_type": "call", | ||
"recording_url": "https://media.plivo.com/v1/Account/MAZTCXYJFKZJK3N2Q3YT/Recording/7ed2395e-e08a-4448-86b1-9770331d94f3.mp3", | ||
"resource_uri": "/v1/Account/MAZTCXYJFKZJK3N2Q3YT/Recording/7ed2395e-e08a-4448-86b1-9770331d94f3/", | ||
"to_number": "sip:[email protected]" | ||
}, | ||
{ | ||
"add_time": "2022-04-12 13:49:19.579419+05:30", | ||
"call_uuid": "b5e575b4-721c-425d-8da5-6c5cf6494487", | ||
"conference_name": "", | ||
"from_number": "+919768368711", | ||
"recording_duration_ms": "25020.00000", | ||
"recording_end_ms": "1649751556401.00000", | ||
"recording_format": "mp3", | ||
"recording_id": "7ed2395e-e08a-4448-86b1-9770331d94f3", | ||
"recording_start_ms": "1649751531381.00000", | ||
"recording_type": "call", | ||
"recording_url": "https://media.plivo.com/v1/Account/MAZTCXYJFKZJK3N2Q3YT/Recording/7ed2395e-e08a-4448-86b1-9770331d94f3.mp3", | ||
"resource_uri": "/v1/Account/MAZTCXYJFKZJK3N2Q3YT/Recording/7ed2395e-e08a-4448-86b1-9770331d94f3/", | ||
"to_number": "sip:[email protected]" | ||
} | ||
] | ||
} |
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 |
---|---|---|
|
@@ -148,3 +148,45 @@ def test_delete(self): | |
|
||
# Verifying the method used | ||
self.assertEqual('DELETE', self.client.current_request.method) | ||
|
||
@with_response(200) | ||
def test_get_added_filter(self): | ||
recording = self.client.recordings.get( | ||
'd405c4eb-d562-4399-af32-6ff3c57fa55x') | ||
|
||
self.assertResponseMatches(recording) | ||
|
||
# Verifying the endpoint hit | ||
self.assertEqual( | ||
'https://api.plivo.com/v1/Account/MAXXXXXXXXXXXXXXXXXX/Recording/d405c4eb-d562-4399-af32-6ff3c57fa55x/', | ||
self.client.current_request.url) | ||
|
||
# Verifying the method used | ||
self.assertEqual('GET', self.client.current_request.method) | ||
|
||
# Verifying the object type returned | ||
self.assertEqual(plivo.resources.recordings.Recording, | ||
recording.__class__) | ||
# verify to and from no param | ||
self.assertEqual('+919768368717', recording.from_number) | ||
|
||
self.assertEqual('sip:[email protected]', recording.to_number) | ||
|
||
@with_response(200) | ||
def test_list_from_filter(self): | ||
recordings = self.client.recordings.list( | ||
call_uuid="f72eea2a-446b-4412-a17f-3b17083bd25a", | ||
from_number="919768368717" | ||
) | ||
|
||
# Verifying the endpoint hit | ||
self.assertUrlEqual( | ||
'https://api.plivo.com/v1/Account/MAXXXXXXXXXXXXXXXXXX/Recording/?call_uuid=f72eea2a-446b-4412-a17f-3b17083bd25a&from_number=919768368717&limit=20&offset=0', | ||
self.client.current_request.url) | ||
|
||
# Verifying if the Account specific changes and parsing happened | ||
self.assertEqual('7ed2395e-e08a-4448-86b1-9770331d94f3', | ||
recordings.objects[1].id) | ||
|
||
self.assertEqual('+919768368717', | ||
recordings.objects[0].from_number) |
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