Skip to content

Commit e861ee0

Browse files
committed
[NDR-323] Skip mock login on pre-prod
1 parent 5a6e6c2 commit e861ee0

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

lambdas/tests/e2e/api/test_login_api.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
import pytest
2+
from tests.e2e.helpers.data_helper import LloydGeorgeDataHelper
23
from tests.e2e.helpers.lloyd_george_mockcis2_helper import LloydGeorgeMockcis2Helper
34

45
# Note this is testing a mock, but this test is valuable to ensure the login code is working for other tests
56

7+
data_helper = LloydGeorgeDataHelper()
68

9+
10+
@pytest.mark.skipif(
11+
data_helper.workspace == "pre-prod", reason="CIS2 login is not mocked in pre-prod"
12+
)
713
@pytest.mark.parametrize(
814
"ods_code, role_to_assume, expected_granted_role",
915
[

lambdas/tests/e2e/api/test_upload_document_api.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,9 @@ def test_create_document_virus(test_data, snapshot_json):
165165
lloyd_george_record["nhs_number"] = "9730154260"
166166

167167
# Attach EICAR data
168-
eicar_string = r"X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*"
168+
eicar_string = (
169+
r"X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*"
170+
)
169171
lloyd_george_record["data"] = base64.b64encode(eicar_string.encode()).decode()
170172

171173
payload = create_upload_payload(lloyd_george_record)
@@ -185,14 +187,16 @@ def test_create_document_virus(test_data, snapshot_json):
185187
def condition(response_json):
186188
logging.info(response_json)
187189
return response_json.get("docStatus") in (
188-
"cancelled",
189-
"final",
190+
"cancelled",
191+
"final",
190192
)
191193

192194
raw_retrieve_response = fetch_with_retry(retrieve_url, condition)
193195
retrieve_response = raw_retrieve_response.json()
194196

195-
assert upload_response == snapshot_json(exclude=paths("id", "date", "content.0.attachment.url"))
197+
assert upload_response == snapshot_json(
198+
exclude=paths("id", "date", "content.0.attachment.url")
199+
)
196200
assert retrieve_response == snapshot_json(exclude=paths("id", "date"))
197201

198202

lambdas/tests/e2e/apim/conftest.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import os
2-
31
import pytest
42

53
from lambdas.tests.e2e.helpers.data_helper import PdmDataHelper

0 commit comments

Comments
 (0)