Skip to content

Commit 4bcc448

Browse files
committed
Manually convert some old-style format strings
1 parent 2101d67 commit 4bcc448

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

tests/notifications_python_client/test_notifications_api_client.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88

99
def test_get_notification_by_id(notifications_client, rmock):
10-
endpoint = "{0}/v2/notifications/{1}".format(TEST_HOST, "123")
10+
endpoint = f"{TEST_HOST}/v2/notifications/123"
1111
rmock.request("GET", endpoint, json={"status": "success"}, status_code=200)
1212

1313
notifications_client.get_notification_by_id(123)
@@ -24,7 +24,7 @@ def test_get_received_texts(notifications_client, rmock):
2424

2525

2626
def test_get_received_texts_older_than(notifications_client, rmock):
27-
endpoint = "{0}/v2/received-text-messages?older_than={1}".format(TEST_HOST, "older_id")
27+
endpoint = f"{TEST_HOST}/v2/received-text-messages?older_than=older_id"
2828
rmock.request("GET", endpoint, json={"status": "success"}, status_code=200)
2929

3030
notifications_client.get_received_texts(older_than="older_id")
@@ -40,7 +40,7 @@ def test_get_all_received_texts_iterator_calls_get_received_texts(notifications_
4040

4141

4242
def test_get_all_notifications_by_type_and_status(notifications_client, rmock):
43-
endpoint = "{0}/v2/notifications?status={1}&template_type={2}".format(TEST_HOST, "status", "type")
43+
endpoint = f"{TEST_HOST}/v2/notifications?status=status&template_type=type"
4444
rmock.request("GET", endpoint, json={"status": "success"}, status_code=200)
4545

4646
notifications_client.get_all_notifications("status", "type")
@@ -49,7 +49,7 @@ def test_get_all_notifications_by_type_and_status(notifications_client, rmock):
4949

5050

5151
def test_get_all_notifications_by_type(notifications_client, rmock):
52-
endpoint = "{0}/v2/notifications?template_type={1}".format(TEST_HOST, "type")
52+
endpoint = f"{TEST_HOST}/v2/notifications?template_type=type"
5353
rmock.request("GET", endpoint, json={"status": "success"}, status_code=200)
5454

5555
notifications_client.get_all_notifications(template_type="type")
@@ -58,7 +58,7 @@ def test_get_all_notifications_by_type(notifications_client, rmock):
5858

5959

6060
def test_get_all_notifications_by_reference(notifications_client, rmock):
61-
endpoint = "{0}/v2/notifications?reference={1}".format(TEST_HOST, "reference")
61+
endpoint = f"{TEST_HOST}/v2/notifications?reference=reference"
6262
rmock.request("GET", endpoint, json={"status": "success"}, status_code=200)
6363

6464
notifications_client.get_all_notifications(reference="reference")
@@ -67,7 +67,7 @@ def test_get_all_notifications_by_reference(notifications_client, rmock):
6767

6868

6969
def test_get_all_notifications_by_older_than(notifications_client, rmock):
70-
endpoint = "{0}/v2/notifications?older_than={1}".format(TEST_HOST, "older_than")
70+
endpoint = f"{TEST_HOST}/v2/notifications?older_than=older_than"
7171
rmock.request("GET", endpoint, json={"status": "success"}, status_code=200)
7272

7373
notifications_client.get_all_notifications(older_than="older_than")
@@ -76,7 +76,7 @@ def test_get_all_notifications_by_older_than(notifications_client, rmock):
7676

7777

7878
def test_get_all_notifications_by_status(notifications_client, rmock):
79-
endpoint = "{0}/v2/notifications?status={1}".format(TEST_HOST, "status")
79+
endpoint = f"{TEST_HOST}/v2/notifications?status=status"
8080
rmock.request("GET", endpoint, json={"status": "success"}, status_code=200)
8181

8282
notifications_client.get_all_notifications(status="status")
@@ -85,7 +85,7 @@ def test_get_all_notifications_by_status(notifications_client, rmock):
8585

8686

8787
def test_get_all_notifications_including_jobs(notifications_client, rmock):
88-
endpoint = "{0}/v2/notifications?include_jobs={1}".format(TEST_HOST, "true")
88+
endpoint = f"{TEST_HOST}/v2/notifications?include_jobs=true"
8989
rmock.request("GET", endpoint, json={"status": "success"}, status_code=200)
9090

9191
notifications_client.get_all_notifications(include_jobs=True)
@@ -175,7 +175,7 @@ def test_create_email_notification_with_personalisation(notifications_client, rm
175175

176176

177177
def test_create_email_notification_with_one_click_unsubscribe_url(notifications_client, rmock):
178-
endpoint = "{0}/v2/notifications/email".format(TEST_HOST)
178+
endpoint = f"{TEST_HOST}/v2/notifications/email"
179179
rmock.request("POST", endpoint, json={"status": "success"}, status_code=200)
180180

181181
notifications_client.send_email_notification(
@@ -373,7 +373,7 @@ def test_get_all_notifications_iterator_gets_more_notifications_with_correct_id(
373373

374374

375375
def test_get_template(notifications_client, rmock):
376-
endpoint = "{0}/v2/template/{1}".format(TEST_HOST, "123")
376+
endpoint = f"{TEST_HOST}/v2/template/{123}"
377377
rmock.request("GET", endpoint, json={"status": "success"}, status_code=200)
378378

379379
notifications_client.get_template(123)
@@ -382,7 +382,7 @@ def test_get_template(notifications_client, rmock):
382382

383383

384384
def test_get_template_version(notifications_client, rmock):
385-
endpoint = "{0}/v2/template/{1}/version/{2}".format(TEST_HOST, "123", 1)
385+
endpoint = f"{TEST_HOST}/v2/template/123/version/1"
386386
rmock.request("GET", endpoint, json={"status": "success"}, status_code=200)
387387

388388
notifications_client.get_template_version(123, 1)
@@ -391,7 +391,7 @@ def test_get_template_version(notifications_client, rmock):
391391

392392

393393
def test_post_template_preview(notifications_client, rmock):
394-
endpoint = "{0}/v2/template/{1}/preview".format(TEST_HOST, "123")
394+
endpoint = f"{TEST_HOST}/v2/template/123/preview"
395395
rmock.request("POST", endpoint, json={"status": "success"}, status_code=200)
396396

397397
notifications_client.post_template_preview(123, personalisation={"name": "chris"})
@@ -410,7 +410,7 @@ def test_get_all_templates(notifications_client, rmock):
410410

411411

412412
def test_get_all_templates_by_type(notifications_client, rmock):
413-
endpoint = "{0}/v2/templates?type={1}".format(TEST_HOST, "type")
413+
endpoint = f"{TEST_HOST}/v2/templates?type=type"
414414
rmock.request("GET", endpoint, json={"status": "success"}, status_code=200)
415415

416416
notifications_client.get_all_templates("type")
@@ -419,7 +419,7 @@ def test_get_all_templates_by_type(notifications_client, rmock):
419419

420420

421421
def test_get_pdf_for_letter(notifications_client, rmock):
422-
endpoint = "{0}/v2/notifications/{1}/pdf".format(TEST_HOST, "123")
422+
endpoint = f"{TEST_HOST}/v2/notifications/123/pdf"
423423
rmock.request("GET", endpoint, content=b"foo", status_code=200)
424424

425425
response = notifications_client.get_pdf_for_letter("123")

0 commit comments

Comments
 (0)