8000 add test_paging_iter test for Recordings resource · PNPtutorials/twilio-python@42bb368 · GitHub
[go: up one dir, main page]

Skip to content

Commit 42bb368

Browse files
committed
add test_paging_iter test for Recordings resource
1 parent 9f62d18 commit 42bb368

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

tests/test_recordings.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,24 @@ def test_paging(mock):
2727
use_json_extension=True)
2828

2929

30+
@patch("twilio.rest.resources.base.make_twilio_request")
31+
def test_paging_iter(mock):
32+
resp = create_mock_json("tests/resources/recordings_list.json")
33+
mock.return_value = resp
34+
35+
uri = "%s/Recordings" % (BASE_URI)
36+
37+
next(recordings.iter(before=date(2010, 12, 5)))
38+
exp_params = {'DateCreated<': '2010-12-05'}
39+
mock.assert_called_with("GET", uri, params=exp_params, auth=AUTH,
40+
use_json_extension=True)
41+
42+
next(recordings.iter(after=date(2012, 12, 7)))
43+
exp_params = {'DateCreated>': '2012-12-07'}
44+
mock.assert_called_with("GET", uri, params=exp_params, auth=AUTH,
45+
use_json_extension=True)
46+
47+
3048
@patch("twilio.rest.resources.base.make_twilio_request")
3149
def test_get(mock):
3250
resp = create_mock_json("tests/resources/recordings_instance.json")

0 commit comments

Comments
 (0)
0