1- import pytest
2-
3-
41class ImmunisationApi :
52
63 def __init__ (self , url , token ):
@@ -10,36 +7,3 @@ def __init__(self, url, token):
107 def get_event_by_id (self , event_id ):
118 # Make your request to our api here and return the response
129 return "response"
13-
14-
15- # TODO: send a GET /event/{id} request
16- # This should give you 404 not found, since there is no event yet (we don't have POST)
17- # Test happy test manually. In both scenarios make sure lambda is getting executed
18- @pytest .mark .nhsd_apim_authorization (
19- {
20- "access" : "healthcare_worker" ,
21- "level" : "aal3" ,
22- "login_form" : {"username" : "656005750104" },
23- }
24- )
25- def test_get_event_by_id_not_found_nhs_login (nhsd_apim_proxy_url , nhsd_apim_auth_headers ):
26- token = nhsd_apim_auth_headers ["access_token" ] # <- not tested
27- imms_api = ImmunisationApi (nhsd_apim_proxy_url , token )
28- res = imms_api .get_event_by_id ("some-id-that-does-not-exist" )
29- print (res )
30- # Make assertions
31-
32-
33- @pytest .mark .smoketest
34- @pytest .mark .nhsd_apim_authorization (
35- {
36- "access" : "application" ,
37- "level" : "level3"
38- })
39- def test_get_event_by_id_not_found_app_restricted (nhsd_apim_proxy_url , nhsd_apim_auth_headers ):
40- # TODO same here but with app restricted, probably refactor both into a function instead of copy paste
41- token = nhsd_apim_auth_headers ["access_token" ] # <- not tested
42- imms_api = ImmunisationApi (nhsd_apim_proxy_url , token )
43- res = imms_api .get_event_by_id ("some-id-that-does-not-exist" )
44- print (res )
45- # Make assertions
0 commit comments