Skip to content

Commit da8fc02

Browse files
NRL-2100 Attempting to get 1DSync tests more realistic and working in public mode pls
1 parent a7bae73 commit da8fc02

6 files changed

Lines changed: 30 additions & 19 deletions

File tree

scripts/get_s3_permissions.py

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ def add_smoke_test_files(local_path):
191191
org_permissions = {
192192
"consumer": [
193193
(
194-
"X26-NRL-6981ad7d-cff4-4613-93d0-df60e5e2fc52", # nrl_app_id
194+
"X26-NRL-6981ad7d-cff4-4613-93d0-df60e5e2fc52",
195195
"SMOKETEST", # ods_code
196196
[
197197
PointerTypes.MENTAL_HEALTH_PLAN.value
@@ -201,19 +201,20 @@ def add_smoke_test_files(local_path):
201201
],
202202
"producer": [
203203
(
204-
"SMOKETEST_1DSYNC",
205-
"SMOKETEST",
206-
[],
207-
[AccessControls.ALLOW_ALL_TYPES.value],
208-
),
209-
(
210-
"X26-NRL-6981ad7d-cff4-4613-93d0-df60e5e2fc52", # nrl_app_id
204+
"X26-NRL-6981ad7d-cff4-4613-93d0-df60e5e2fc52",
211205
"SMOKETEST", # ods_code
212206
[
213207
PointerTypes.MENTAL_HEALTH_PLAN.value
214208
], # http://snomed.info/sct|736253002
215209
[],
216210
),
211+
(
212+
# For public tests - don't have a separate apigee app for 1DSync
213+
"X26-NRL-6981ad7d-cff4-4613-93d0-df60e5e2fc52",
214+
"SMOKETEST1DSYNC",
215+
[],
216+
[AccessControls.ALLOW_ALL_TYPES.value],
217+
),
217218
],
218219
}
219220
[
@@ -227,11 +228,12 @@ def add_smoke_test_files(local_path):
227228
for app_id, ods_code, pointer_types, access_controls in entries
228229
]
229230
app_permissions = {
230-
"consumer": [
231-
("app-t001", [PointerTypes.MENTAL_HEALTH_PLAN.value], []),
232-
],
233231
"producer": [
234-
("app-t001", [PointerTypes.EOL_COORDINATION_SUMMARY.value], []),
232+
(
233+
"SMOKETEST1DSYNC",
234+
[],
235+
[AccessControls.ALLOW_ALL_TYPES.value],
236+
),
235237
],
236238
}
237239
[
@@ -248,7 +250,7 @@ def add_smoke_test_files(local_path):
248250
print("Adding smoke test v1 permissions to temporary directory...")
249251
v1_permissions = [
250252
(
251-
"SMOKETEST_1DSYNC_V1",
253+
"SMOKETEST1DSYNCV1",
252254
"SMOKETEST",
253255
[], # not needed, won't hit this file
254256
),

tests/smoke/scenarios/1dsync_upsert_delete.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@ def producer_client_1dsync(
1616
client_config.connection_metadata["nrl.permissions"] = [
1717
PERMISSION_ALLOW_ALL_POINTER_TYPES
1818
]
19-
client_config.connection_metadata["nrl.app-id"] = "SMOKETEST_1DSYNC"
19+
client_config.connection_metadata["nrl.app-id"] = "SMOKETEST1DSYNC"
20+
else:
21+
client_config.custom_headers["NHSD-End-User-Organisation-ODS"] = (
22+
"SMOKETEST1DSYNC"
23+
)
2024

2125
return ProducerTestClient(config=client_config)
2226

tests/smoke/scenarios/1dsync_upsert_delete_v1.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
import pytest
22

3-
from nrlf.core.constants import PERMISSION_ALLOW_ALL_POINTER_TYPES
3+
from nrlf.core.constants import PERMISSION_ALLOW_ALL_POINTER_TYPES, V2Headers
44
from tests.smoke.environment import ConnectMode, EnvironmentConfig, SmokeTestParameters
55
from tests.smoke.setup import build_document_reference
66
from tests.utilities.api_clients import ProducerTestClient
77

8+
v1_1dsync_app_id = "SMOKETEST_1DSYNC_V1"
9+
810

911
@pytest.fixture
1012
def producer_client_1dsync_v1(
@@ -16,7 +18,10 @@ def producer_client_1dsync_v1(
1618
client_config.connection_metadata["nrl.permissions"] = [
1719
PERMISSION_ALLOW_ALL_POINTER_TYPES
1820
]
19-
client_config.connection_metadata["nrl.app-id"] = "SMOKETEST_1DSYNC_V1"
21+
client_config.connection_metadata["nrl.app-id"] = v1_1dsync_app_id
22+
client_config.custom_headers[V2Headers.X_PROXYGEN_APP_NRL_APP_ID] = (
23+
v1_1dsync_app_id
24+
)
2025

2126
return ProducerTestClient(config=client_config)
2227

tests/smoke/scenarios/consumer_search_read_v1.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def test_smoke_consumer_search_read(
4040
consumer_client: ConsumerTestClient, test_data_v1: dict
4141
):
4242
"""
43-
Smoke test scenario for a consumer search and read behavior
43+
Smoke test scenario for a consumer search and read behaviour
4444
"""
4545
patient_id = test_data_v1["patient_nhs_number"]
4646
test_pointers = test_data_v1["pointers"]

tests/smoke/scenarios/producer_crud_v1.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ def test_smoke_producer_crud_v1(
99
smoke_test_parameters: SmokeTestParameters,
1010
):
1111
"""
12-
Smoke test scenario for producer CRUD behavior
12+
Smoke test scenario for producer CRUD behaviour
1313
"""
1414
test_ods_code = smoke_test_parameters.v1_ods_code
1515
test_docref = build_document_reference(

tests/smoke/scenarios/producer_search_read_v1.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def test_smoke_producer_search_read(
4040
producer_client_v1: ProducerTestClient, test_data: dict
4141
):
4242
"""
43-
Smoke test scenario for a producer search and read behavior
43+
Smoke test scenario for a producer search and read behaviour
4444
"""
4545
patient_id = test_data["patient_nhs_number"]
4646
test_pointers = test_data["pointers"]

0 commit comments

Comments
 (0)