7
7
8
8
9
9
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"
11
11
rmock .request ("GET" , endpoint , json = {"status" : "success" }, status_code = 200 )
12
12
13
13
notifications_client .get_notification_by_id (123 )
@@ -24,7 +24,7 @@ def test_get_received_texts(notifications_client, rmock):
24
24
25
25
26
26
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"
28
28
rmock .request ("GET" , endpoint , json = {"status" : "success" }, status_code = 200 )
29
29
30
30
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_
40
40
41
41
42
42
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"
44
44
rmock .request ("GET" , endpoint , json = {"status" : "success" }, status_code = 200 )
45
45
46
46
notifications_client .get_all_notifications ("status" , "type" )
@@ -49,7 +49,7 @@ def test_get_all_notifications_by_type_and_status(notifications_client, rmock):
49
49
50
50
51
51
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"
53
53
rmock .request ("GET" , endpoint , json = {"status" : "success" }, status_code = 200 )
54
54
55
55
notifications_client .get_all_notifications (template_type = "type" )
@@ -58,7 +58,7 @@ def test_get_all_notifications_by_type(notifications_client, rmock):
58
58
59
59
60
60
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"
62
62
rmock .request ("GET" , endpoint , json = {"status" : "success" }, status_code = 200 )
63
63
64
64
notifications_client .get_all_notifications (reference = "reference" )
@@ -67,7 +67,7 @@ def test_get_all_notifications_by_reference(notifications_client, rmock):
67
67
68
68
69
69
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"
71
71
rmock .request ("GET" , endpoint , json = {"status" : "success" }, status_code = 200 )
72
72
73
73
notifications_client .get_all_notifications (older_than = "older_than" )
@@ -76,7 +76,7 @@ def test_get_all_notifications_by_older_than(notifications_client, rmock):
76
76
77
77
78
78
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"
80
80
rmock .request ("GET" , endpoint , json = {"status" : "success" }, status_code = 200 )
81
81
82
82
notifications_client .get_all_notifications (status = "status" )
@@ -85,7 +85,7 @@ def test_get_all_notifications_by_status(notifications_client, rmock):
85
85
86
86
87
87
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"
89
89
rmock .request ("GET" , endpoint , json = {"status" : "success" }, status_code = 200 )
90
90
91
91
notifications_client .get_all_notifications (include_jobs = True )
@@ -175,7 +175,7 @@ def test_create_email_notification_with_personalisation(notifications_client, rm
175
175
176
176
177
177
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"
179
179
rmock .request ("POST" , endpoint , json = {"status" : "success" }, status_code = 200 )
180
180
181
181
notifications_client .send_email_notification (
@@ -373,7 +373,7 @@ def test_get_all_notifications_iterator_gets_more_notifications_with_correct_id(
373
373
374
374
375
375
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 } "
377
377
rmock .request ("GET" , endpoint , json = {"status" : "success" }, status_code = 200 )
378
378
379
379
notifications_client .get_template (123 )
@@ -382,7 +382,7 @@ def test_get_template(notifications_client, rmock):
382
382
383
383
384
384
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"
386
386
rmock .request ("GET" , endpoint , json = {"status" : "success" }, status_code = 200 )
387
387
388
388
notifications_client .get_template_version (123 , 1 )
@@ -391,7 +391,7 @@ def test_get_template_version(notifications_client, rmock):
391
391
392
392
393
393
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"
395
395
rmock .request ("POST" , endpoint , json = {"status" : "success" }, status_code = 200 )
396
396
397
397
notifications_client .post_template_preview (123 , personalisation = {"name" : "chris" })
@@ -410,7 +410,7 @@ def test_get_all_templates(notifications_client, rmock):
410
410
411
411
412
412
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"
414
414
rmock .request ("GET" , endpoint , json = {"status" : "success" }, status_code = 200 )
415
415
416
416
notifications_client .get_all_templates ("type" )
@@ -419,7 +419,7 @@ def test_get_all_templates_by_type(notifications_client, rmock):
419
419
420
420
421
421
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"
423
423
rmock .request ("GET" , endpoint , content = b"foo" , status_code = 200 )
424
424
425
425
response = notifications_client .get_pdf_for_letter ("123" )
0 commit comments