Skip to content

Commit f63e901

Browse files
igba1980igba.ujege
andauthored
Uncommented old test (#44)
* Uncommented old test * Added scope * fixed application scope * Added scope for level0 * removed redundant level0 test --------- Co-authored-by: igba.ujege <igba.ujege@bjss.com>
1 parent 3cd1288 commit f63e901

2 files changed

Lines changed: 11 additions & 14 deletions

File tree

manifest_template.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,11 @@ apigee:
8282
environments: [ {{ ENV.name }} ]
8383
proxies:
8484
- {{ NAME }}
85+
- identity-service-{{ ENV.name }}
86+
scopes:
87+
- 'urn:nhsd:apim:user-nhs-cis2:aal3:{{ SERVICE_NAME }}'
88+
- 'urn:nhsd:apim:app:level3:{{ SERVICE_NAME }}'
89+
- 'urn:nhsd:apim:user-nhs-id:aal3:{{ SERVICE_NAME }}'
8590
specs:
8691
- name: {{ NAME }}
8792
path: {{ SERVICE_NAME }}.json

tests/test_endpoints.py

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
import os
1010

1111

12-
@pytest.mark.skip(reason="Temporarily disabled 30/10/2023")
1312
@pytest.mark.smoketest
1413
def test_ping(nhsd_apim_proxy_url):
1514
os.environ["PROXY_NAME"] = "dev"
@@ -18,7 +17,6 @@ def test_ping(nhsd_apim_proxy_url):
1817
assert resp.status_code == 200
1918

2019

21-
@pytest.mark.skip(reason="Temporarily disabled 30/10/2023")
2220
@pytest.mark.smoketest
2321
def test_wait_for_ping(nhsd_apim_proxy_url):
2422
retries = 0
@@ -40,7 +38,6 @@ def test_wait_for_ping(nhsd_apim_proxy_url):
4038
assert deployed_commitId == getenv('SOURCE_COMMIT_ID')
4139

4240

43-
@pytest.mark.skip(reason="Temporarily disabled 30/10/2023")
4441
@pytest.mark.smoketest
4542
def test_status(nhsd_apim_proxy_url, status_endpoint_auth_headers):
4643
resp = requests.get(
@@ -50,7 +47,6 @@ def test_status(nhsd_apim_proxy_url, status_endpoint_auth_headers):
5047
# Make some additional assertions about your status response here!
5148

5249

53-
@pytest.mark.skip(reason="Temporarily disabled 30/10/2023")
5450
@pytest.mark.smoketest
5551
def test_wait_for_status(nhsd_apim_proxy_url, status_endpoint_auth_headers):
5652
retries = 0
@@ -75,21 +71,17 @@ def test_wait_for_status(nhsd_apim_proxy_url, status_endpoint_auth_headers):
7571
assert deployed_commitId == getenv('SOURCE_COMMIT_ID')
7672

7773

78-
@pytest.mark.skip(reason="Temporarily disabled 16/11/2023")
79-
@pytest.mark.nhsd_apim_authorization({"access": "application", "level": "level0"})
80-
def test_app_level0(nhsd_apim_proxy_url, nhsd_apim_auth_headers):
81-
resp = requests.get(f"{nhsd_apim_proxy_url}", headers=nhsd_apim_auth_headers)
74+
def test_app_unauthorised(nhsd_apim_proxy_url, nhsd_apim_auth_headers):
75+
resp = requests.get(f"{nhsd_apim_proxy_url}/conditions/", headers=nhsd_apim_auth_headers)
8276
assert resp.status_code == 401 # unauthorized
8377

8478

85-
@pytest.mark.skip(reason="Temporarily disabled 16/11/2023")
8679
@pytest.mark.nhsd_apim_authorization({"access": "application", "level": "level3"})
8780
def test_app_level3(nhsd_apim_proxy_url, nhsd_apim_auth_headers):
88-
resp = requests.get(f"{nhsd_apim_proxy_url}", headers=nhsd_apim_auth_headers)
89-
assert resp.status_code == 200
81+
resp = requests.get(f"{nhsd_apim_proxy_url}/conditions/", headers=nhsd_apim_auth_headers)
82+
assert resp.status_code == 401
9083

9184

92-
@pytest.mark.skip(reason="Temporarily disabled 16/11/2023")
9385
@pytest.mark.nhsd_apim_authorization(
9486
{
9587
"access": "healthcare_worker",
@@ -98,5 +90,5 @@ def test_app_level3(nhsd_apim_proxy_url, nhsd_apim_auth_headers):
9890
}
9991
)
10092
def test_cis2_aal3(nhsd_apim_proxy_url, nhsd_apim_auth_headers):
101-
resp = requests.get(f"{nhsd_apim_proxy_url}", headers=nhsd_apim_auth_headers)
102-
assert resp.status_code == 200
93+
resp = requests.get(f"{nhsd_apim_proxy_url}/conditions/", headers=nhsd_apim_auth_headers)
94+
assert resp.status_code == 401

0 commit comments

Comments
 (0)