8000 made url mandatory in dequeue · thinkingserious/twilio-python@867a286 · GitHub
[go: up one dir, main page]

Skip to content

Commit 867a286

Browse files
committed
made url mandatory in dequeue
1 parent 866eba5 commit 867a286

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

tests/test_members.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
CALL_SID = "CAaaf2e9ded94aba3e57c42a3d55be6ff2"
1212
BASE_URI = "https://api.twilio.com/2010-04-01/Accounts/AC123/Queues/%s" % (
1313
QUEUE_SID)
14+
TWIML_URL = "example_twiml_url"
1415

1516
list_resource = Members(BASE_URI, AUTH)
1617

@@ -30,16 +31,16 @@ def test_members_dequeue_front(mock):
3031
mock.return_value = resp
3132

3233
uri = "%s/Members/Front" % (BASE_URI)
33-
list_resource.dequeue()
34+
list_resource.dequeue(TWIML_URL)
3435

35-
mock.assert_called_with("POST", uri, data={}, auth=AUTH)
36+
mock.assert_called_with("POST", uri, data={"Url": TWIML_URL}, auth=AUTH)
3637

3738
@patch("twilio.rest.resources.make_twilio_request")
3839
def test_members_dequeue_call(mock):
3940
resp = create_mock_json("tests/resources/members_instance.json")
4041
mock.return_value = resp
4142

4243
uri = "%s/Members/%s" % (BASE_URI, CALL_SID)
43-
list_resource.dequeue(call_sid=CALL_SID)
44+
list_resource.dequeue(TWIML_URL, call_sid=CALL_SID)
4445

45-
mock.assert_called_with("POST", uri, data={}, auth=AUTH)
46+
mock.assert_called_with("POST", uri, data={"Url": TWIML_URL}, auth=AUTH)

twilio/rest/resources.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1158,7 +1158,7 @@ def list(self, **kwargs):
11581158
"""
11591159
return self.get_instances(kwargs)
11601160

1161-
def dequeue(self, call_sid='Front', **kwargs):
1161+
def dequeue(self, url, call_sid='Front'):
11621162
"""
11631163
Dequeues a member from the queue and have the member's call
11641164
begin executing the TwiML document at the url.
@@ -1167,7 +1167,7 @@ def dequeue(self, call_sid='Front', **kwargs):
11671167
the member at the front of the queue will be used
11681168
:param url: url of the TwiML document to be executed.
11691169
"""
1170-
return self.update_instance(call_sid, kwargs)
1170+
return self.update_instance(call_sid, {"url":url})
11711171

11721172

11731173
class Queue(InstanceResource):

0 commit comments

Comments
 (0)
0