8000 Remove all calls for .format · Twilio-api/twilio-python@8cfbc5b · GitHub
[go: up one dir, main page]

Skip to content

Commit 8cfbc5b

Browse files
committed
Remove all calls for .format
1 parent c9015ab commit 8cfbc5b

File tree

7 files changed

+18
-18
lines changed

7 files changed

+18
-18
lines changed

tests/resources/process.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
sid = "ed59a5733d2c1c1c69a83a28"
1111

1212
def twilio_clean(contents):
13-
contents = re.sub(r"([A-Z]{2}\w{8})\w{24}", r"\1{}".format(sid), contents)
13+
contents = re.sub(r"([A-Z]{2}\w{8})\w{24}", r"\1%s" % sid, contents)
1414
contents = re.sub(r"\"[a-z0-9]{32}\"", "\"AUTHTOKEN\"", contents)
1515
contents = re.sub(r"\+\d{10}", r"+14158675309", contents)
1616
contents = re.sub(r"[0-9\- \(\)]{14}", r"(415) 867-5309", contents)

tests/test_base_resource.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
def test_resource_init():
1818
r = Resource(base_uri, auth)
19-
uri = "{}/{}".format(base_uri, r.name)
19+
uri = "%s/%s" % (base_uri, r.name)
2020

2121
assert_equals(r.base_uri, base_uri)
2222
assert_equals(r.auth, auth)
@@ -35,7 +35,7 @@ def setUp(self):
3535
self.r = ListResource(base_uri, auth)
3636

3737
def testListResourceInit(self):
38-
uri = "{}/{}".format(base_uri, self.r.name)
38+
uri = "%s/%s" % (base_uri, self.r.name)
3939
self.assertEquals(self.r.uri, uri)
4040

4141
def testKeyValue(self):

tests/test_calls.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def test_paging(mock):
1616
resp = create_mock_json("tests/resources/calls_list.json")
1717
mock.return_value = resp
1818

19-
uri = "{}/Calls".format(BASE_URI)
19+
uri = "%s/Calls" % (BASE_URI)
2020
list_resource.list(started=date(2010,12,5))
2121
exp_params = {'StartTime': '2010-12-05'}
2222

@@ -27,7 +27,7 @@ def test_paging(mock):
2727
resp = create_mock_json("tests/resources/calls_list.json")
2828
mock.return_value = resp
2929

30-
uri = "{}/Calls".format(BASE_URI)
30+
uri = "%s/Calls" % (BASE_URI)
3131
list_resource.list(started_before=date(2010,12,5))
3232
exp_params = {'StartTime<': '2010-12-05'}
3333

@@ -38,7 +38,7 @@ def test_get(mock):
3838
resp = create_mock_json("tests/resources/calls_instance.json")
3939
mock.return_value = resp
4040

41-
uri = "{}/Calls/{}".format(BASE_URI, CALL_SID)
41+
uri = "%s/Calls/%s" % (BASE_URI, CALL_SID)
4242
r = list_resource.get(CALL_SID)
4343

4444
mock.assert_called_with("GET", uri, auth=AUTH)
@@ -49,7 +49,7 @@ def test_hangup(mock):
4949
resp.status_code = 204
5050
mock.return_value = resp
5151

52-
uri = "{}/Calls/{}".format(BASE_URI, CALL_SID)
52+
uri = "%s/Calls/%s" % (BASE_URI, CALL_SID)
5353
r = list_resource.hangup(CALL_SID)
5454
exp_data = {"Status": "completed"}
5555

@@ -62,7 +62,7 @@ def test_cancel(mock):
6262
resp.status_code = 204
6363
mock.return_value = resp
6464

65-
uri = "{}/Calls/{}".format(BASE_URI, CALL_SID)
65+
uri = "%s/Calls/%s" % (BASE_URI, CALL_SID)
6666
r = list_resource.cancel(CALL_SID)
6767
exp_data = {"Status": "canceled"}
6868

tests/test_make_request.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from twilio.rest.resources import make_twilio_request
1515

1616
get_headers = {
17-
"User-Agent": "twilio-python/{}".format(twilio.__version__),
17+
"User-Agent": "twilio-python/%s" % (twilio.__version__),
1818
"Accept": "application/json",
1919
}
2020

tests/test_notifications.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def test_paging(mock):
1717
resp = create_mock_json("tests/resources/notifications_list.json")
1818
mock.return_value = resp
1919

20-
uri = "{}/Notifications".format(BASE_URI)
20+
uri = "%s/Notifications" % (BASE_URI)
2121
list_resource.list(before=date(2010,12,5))
2222
exp_params = {'MessageDate<': '2010-12-05'}
2323

@@ -28,7 +28,7 @@ def test_get(mock):
2828
resp = create_mock_json("tests/resources/notifications_instance.json")
2929
mock.return_value = resp
3030

31-
uri = "{}/Notifications/{}".format(BASE_URI, RE_SID)
31+
uri = "%s/Notifications/%s" % (BASE_URI, RE_SID)
3232
r = list_reosource.get(RE_SID)
3333

3434
mock.assert_called_with("GET", uri, auth=AUTH)
@@ -39,7 +39,7 @@ def test_get(mock):
3939
resp.status_code = 204
4040
mock.return_value = resp
4141

42-
uri = "{}/Notifications/{}".format(BASE_URI, RE_SID)
42+
uri = "%s/Notifications/%s" % (BASE_URI, RE_SID)
4343
r = list_resource.delete(RE_SID)
4444

4545
mock.assert_called_with("DELETE", uri, auth=AUTH)

tests/test_recordings.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def test_paging(mock):
1717
resp = create_mock_json("tests/resources/recordings_list.json")
1818
mock.return_value = resp
1919

20-
uri = "{}/Recordings".format(BASE_URI)
20+
uri = "%s/Recordings" % (BASE_URI)
2121
recordings.list(call_sid="CA123", before=date(2010,12,5))
2222
exp_params = {'CallSid': 'CA123', 'DateCreated<': '2010-12-05'}
2323

@@ -28,12 +28,12 @@ def test_get(mock):
2828
resp = create_mock_json("tests/resources/recordings_instance.json")
2929
mock.return_value = resp
3030

31-
uri = "{}/Recordings/{}".format(BASE_URI, RE_SID)
31+
uri = "%s/Recordings/%s" % (BASE_URI, RE_SID)
3232
r = recordings.get(RE_SID)
3333

3434
mock.assert_called_with("GET", uri, auth=AUTH)
3535

36-
truri = "{}/Recordings/{}/Transcriptions".format(BASE_URI, RE_SID)
36+
truri = "%s/Recordings/%s/Transcriptions" % (BASE_URI, RE_SID)
3737
assert_equals(r.transcriptions.uri, truri)
3838

3939
@patch("twilio.rest.resources.make_twilio_request")
@@ -42,7 +42,7 @@ def test_get(mock):
4242
resp.status_code = 204
4343
mock.return_value = resp
4444

45-
uri = "{}/Recordings/{}".format(BASE_URI, RE_SID)
45+
uri = "%s/Recordings/%s" % (BASE_URI, RE_SID)
4646
r = recordings.delete(RE_SID)
4747

4848
mock.assert_called_with("DELETE", uri, auth=AUTH)

tests/test_transcriptions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def test_paging(mock):
1515
resp = create_mock_json("tests/resources/transcriptions_list.json")
1616
mock.return_value = resp
1717

18-
uri = "{}/Transcriptions".format(BASE_URI)
18+
uri = "%s/Transcriptions" % (BASE_URI)
1919
transcriptions.list(page=2)
2020

2121
mock.assert_called_with("GET", uri, params={"Page": 2}, auth=AUTH)
@@ -25,7 +25,7 @@ def test_get(mock):
2525
resp = create_mock_json("tests/resources/transcriptions_instance.json")
2626
mock.return_value = resp
2727

28-
uri = "{}/Transcriptions/TR123".format(BASE_URI)
28+
uri = "%s/Transcriptions/TR123" % (BASE_URI)
2929
transcriptions.get("TR123")
3030

3131
mock.assert_called_with("GET", uri, auth=AUTH)

0 commit comments

Comments
 (0)
0