Skip to content

Commit 0b9c208

Browse files
committed
release/2025-02-05 Add changelog scenario integration tests
1 parent d05de09 commit 0b9c208

File tree

10 files changed

+372
-0
lines changed

10 files changed

+372
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
dn: uniqueIdentifier=000000000001,ou=Services,o=nhs
2+
changeType: add
3+
objectClass: nhsAs
4+
objectClass: top
5+
nhsApproverURP: uniqueIdentifier=102583034545,uniqueIdentifier=352307522545,uid=432776896545,ou=People,o=nhs
6+
nhsAsClient: C3O9X
7+
nhsAsSvcIA: urn:nhs:names:services:pdsquery:QUQI_IN010000UK14
8+
nhsDateApproved: 20091016133823
9+
nhsDateRequested: 20091016133757
10+
nhsIDCode: C3O9X
11+
nhsMHSPartyKey: C3O9X-806782
12+
nhsProductKey: 6216
13+
nhsProductName: TPP SystmOne
14+
nhsRequestorURP: uniqueIdentifier=203171972540,uniqueIdentifier=352307522545,uid=432776896545,ou=People,o=nhs
15+
nhsTempUid: 10312
16+
uniqueIdentifier: 000000000001
17+
nhsMhsManufacturerOrg: C3O9X
18+
nhsAsACF: AS ACF
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
replace: nhsAsACF
2+
-
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
replace: nhstempuid
2+
-
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
from etl.sds.tests.changelog.utils import (
2+
ADD_ACCREDITED_SYSTEM_WITH_ACF,
3+
MODIFY_ACCREDITED_SYSTEM_REPLACE_DEVICE_LIST_FIELD_WITH_EMPTY,
4+
_Scenario,
5+
)
6+
7+
SCENARIO = _Scenario(
8+
file_path=__file__,
9+
extract_input=[
10+
ADD_ACCREDITED_SYSTEM_WITH_ACF,
11+
MODIFY_ACCREDITED_SYSTEM_REPLACE_DEVICE_LIST_FIELD_WITH_EMPTY,
12+
],
13+
)
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
[
2+
{
3+
"change_type": "add",
4+
"nhs_approver_urp": "uniqueIdentifier=102583034545,uniqueIdentifier=352307522545,uid=432776896545,ou=People,o=nhs",
5+
"nhs_as_svc_ia": ["urn:nhs:names:services:pdsquery:QUQI_IN010000UK14"],
6+
"nhs_date_approved": "20091016133823",
7+
"nhs_date_requested": "20091016133757",
8+
"nhs_as_client": ["C3O9X"],
9+
"nhs_id_code": "C3O9X",
10+
"nhs_mhs_manufacturer_org": "C3O9X",
11+
"nhs_mhs_party_key": "C3O9X-806782",
12+
"nhs_product_key": "6216",
13+
"nhs_product_name": "TPP SystmOne",
14+
"nhs_product_version": null,
15+
"nhs_requestor_urp": "uniqueIdentifier=203171972540,uniqueIdentifier=352307522545,uid=432776896545,ou=People,o=nhs",
16+
"nhs_temp_uid": "10312",
17+
"object_class": "nhsAs",
18+
"unique_identifier": "000000000001",
19+
"nhs_as_acf": ["AS ACF"],
20+
"nhs_as_category_bag": null,
21+
"description": null
22+
},
23+
{
24+
"change_type": "modify",
25+
"object_class": "modify",
26+
"modifications": [["replace", "nhsasacf", []]],
27+
"unique_identifier": "000000000001"
28+
}
29+
]
Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
[
2+
{
3+
"id": "C3O9X.fe49c1d5-d9bc-4c2e-8e8d-54d8e2e88250",
4+
"name": "C3O9X (EPR)",
5+
"ods_code": "C3O9X",
6+
"status": "active",
7+
"created_on": "2024-12-11T11:18:53.365591+00:00",
8+
"updated_on": null,
9+
"deleted_on": null,
10+
"keys": [
11+
{
12+
"key_type": "epr_id",
13+
"key_value": "EPR-C3O9X"
14+
}
15+
]
16+
},
17+
{
18+
"id": "P.9AN-PJG",
19+
"product_team_id": "C3O9X.fe49c1d5-d9bc-4c2e-8e8d-54d8e2e88250",
20+
"name": "TPP SystmOne",
21+
"ods_code": "C3O9X",
22+
"status": "active",
23+
"created_on": "2024-12-11T11:18:53.407960+00:00",
24+
"updated_on": "2024-12-11T11:18:53.408432+00:00",
25+
"deleted_on": null,
26+
"keys": [
27+
{
28+
"key_type": "party_key",
29+
"key_value": "C3O9X-806782"
30+
}
31+
]
32+
},
33+
{
34+
"id": "fe15bd58-6897-4566-9a87-aab781fd96b5",
35+
"name": "C3O9X-806782/000000000001 - Accredited System",
36+
"status": "active",
37+
"product_id": "P.9AN-PJG",
38+
"product_team_id": "C3O9X.fe49c1d5-d9bc-4c2e-8e8d-54d8e2e88250",
39+
"ods_code": "C3O9X",
40+
"environment": "prod",
41+
"created_on": "2024-12-11T11:18:53.532840+00:00",
42+
"updated_on": "2024-12-11T11:18:53.534066+00:00",
43+
"deleted_on": null,
44+
"keys": [
45+
{
46+
"key_type": "accredited_system_id",
47+
"key_value": "000000000001"
48+
}
49+
],
50+
"tags": [
51+
{
52+
"nhs_id_code": "C3O9X",
53+
"nhs_as_svc_ia": "urn:nhs:names:services:pdsquery:QUQI_IN010000UK14"
54+
},
55+
{
56+
"nhs_id_code": "C3O9X",
57+
"nhs_as_svc_ia": "urn:nhs:names:services:pdsquery:QUQI_IN010000UK14",
58+
"nhs_mhs_party_key": "C3O9X-806782"
59+
}
60+
],
61+
"questionnaire_responses": {
62+
"spine_as/1": [
63+
{
64+
"id": "07dacf01-359a-4276-9dd2-e11ecb07076a",
65+
"questionnaire_name": "spine_as",
66+
"questionnaire_version": "1",
67+
"data": {
68+
"Client ODS Codes": ["C3O9X"],
69+
"MHS Party Key": "C3O9X-806782",
70+
"ASID": "000000000001",
71+
"ODS Code": "C3O9X",
72+
"Temp UID": "10312",
73+
"Product Key": "6216",
74+
"Product Name": "TPP SystmOne",
75+
"Product Version": null,
76+
"Date Requested": "20091016133757",
77+
"Date Approved": "20091016133823",
78+
"Approver URP": "uniqueIdentifier=102583034545,uniqueIdentifier=352307522545,uid=432776896545,ou=People,o=nhs",
79+
"Requestor URP": "uniqueIdentifier=203171972540,uniqueIdentifier=352307522545,uid=432776896545,ou=People,o=nhs",
80+
"MHS Manufacturer Organisation": "C3O9X",
81+
"AS ACF": []
82+
},
83+
"created_on": "2024-12-11T11:18:53.456536+00:00"
84+
}
85+
]
86+
},
87+
"device_reference_data": {
88+
"390fc252-02a2-494e-b6fb-16717eec7168": ["*.Interaction ID"],
89+
"68cd98db-5d8d-45dc-ba9a-09e892535d83": ["*.Interaction ID"]
90+
}
91+
},
92+
{
93+
"id": "390fc252-02a2-494e-b6fb-16717eec7168",
94+
"name": "C3O9X-806782 - MHS Message Sets",
95+
"status": "active",
96+
"product_id": "P.9AN-PJG",
97+
"product_team_id": "C3O9X.fe49c1d5-d9bc-4c2e-8e8d-54d8e2e88250",
98+
"ods_code": "C3O9X",
99+
"environment": "prod",
100+
"questionnaire_responses": {},
101+
"created_on": "2024-12-11T11:18:53.452472+00:00",
102+
"updated_on": null,
103+
"deleted_on": null
104+
},
105+
{
106+
"id": "68cd98db-5d8d-45dc-ba9a-09e892535d83",
107+
"name": "C3O9X-806782 - AS Additional Interactions",
108+
"status": "active",
109+
"product_id": "P.9AN-PJG",
110+
"product_team_id": "C3O9X.fe49c1d5-d9bc-4c2e-8e8d-54d8e2e88250",
111+
"ods_code": "C3O9X",
112+
"environment": "prod",
113+
"questionnaire_responses": {
114+
"spine_as_additional_interactions/1": [
115+
{
116+
"id": "2071f8ac-a020-4bf3-b413-c205004bfb08",
117+
"questionnaire_name": "spine_as_additional_interactions",
118+
"questionnaire_version": "1",
119+
"data": {
120+
"Interaction ID": "urn:nhs:names:services:pdsquery:QUQI_IN010000UK14"
121+
},
122+
"created_on": "2024-12-11T11:18:53.409854+00:00"
123+
}
124+
]
125+
},
126+
"created_on": "2024-12-11T11:18:53.452472+00:00",
127+
"updated_on": "2024-12-11T11:18:53.452853+00:00",
128+
"deleted_on": null
129+
}
130+
]
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
from etl.sds.tests.changelog.utils import (
2+
ADD_ACCREDITED_SYSTEM,
3+
MODIFY_ACCREDITED_SYSTEM_REPLACE_DEVICE_NON_LIST_FIELD_WITH_EMPTY,
4+
_Scenario,
5+
)
6+
7+
SCENARIO = _Scenario(
8+
file_path=__file__,
9+
extract_input=[
10+
ADD_ACCREDITED_SYSTEM,
11+
MODIFY_ACCREDITED_SYSTEM_REPLACE_DEVICE_NON_LIST_FIELD_WITH_EMPTY,
12+
],
13+
)
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
[
2+
{
3+
"change_type": "add",
4+
"nhs_approver_urp": "uniqueIdentifier=102583034545,uniqueIdentifier=352307522545,uid=432776896545,ou=People,o=nhs",
5+
"nhs_as_svc_ia": ["urn:nhs:names:services:pdsquery:QUQI_IN010000UK14"],
6+
"nhs_date_approved": "20091016133823",
7+
"nhs_date_requested": "20091016133757",
8+
"nhs_as_client": ["C3O9X"],
9+
"nhs_id_code": "C3O9X",
10+
"nhs_mhs_manufacturer_org": "C3O9X",
11+
"nhs_mhs_party_key": "C3O9X-806782",
12+
"nhs_product_key": "6216",
13+
"nhs_product_name": "TPP SystmOne",
14+
"nhs_product_version": null,
15+
"nhs_requestor_urp": "uniqueIdentifier=203171972540,uniqueIdentifier=352307522545,uid=432776896545,ou=People,o=nhs",
16+
"nhs_temp_uid": "10312",
17+
"object_class": "nhsAs",
18+
"unique_identifier": "000000000001",
19+
"nhs_as_acf": null,
20+
"nhs_as_category_bag": null,
21+
"description": null
22+
},
23+
{
24+
"change_type": "modify",
25+
"object_class": "modify",
26+
"modifications": [["replace", "nhstempuid", []]],
27+
"unique_identifier": "000000000001"
28+
}
29+
]
Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
[
2+
{
3+
"id": "C3O9X.fe49c1d5-d9bc-4c2e-8e8d-54d8e2e88250",
4+
"name": "C3O9X (EPR)",
5+
"ods_code": "C3O9X",
6+
"status": "active",
7+
"created_on": "2024-12-11T11:18:53.365591+00:00",
8+
"updated_on": null,
9+
"deleted_on": null,
10+
"keys": [
11+
{
12+
"key_type": "epr_id",
13+
"key_value": "EPR-C3O9X"
14+
}
15+
]
16+
},
17+
{
18+
"id": "P.9AN-PJG",
19+
"product_team_id": "C3O9X.fe49c1d5-d9bc-4c2e-8e8d-54d8e2e88250",
20+
"name": "TPP SystmOne",
21+
"ods_code": "C3O9X",
22+
"status": "active",
23+
"created_on": "2024-12-11T11:18:53.407960+00:00",
24+
"updated_on": "2024-12-11T11:18:53.408432+00:00",
25+
"deleted_on": null,
26+
"keys": [
27+
{
28+
"key_type": "party_key",
29+
"key_value": "C3O9X-806782"
30+
}
31+
]
32+
},
33+
{
34+
"id": "fe15bd58-6897-4566-9a87-aab781fd96b5",
35+
"name": "C3O9X-806782/000000000001 - Accredited System",
36+
"status": "active",
37+
"product_id": "P.9AN-PJG",
38+
"product_team_id": "C3O9X.fe49c1d5-d9bc-4c2e-8e8d-54d8e2e88250",
39+
"ods_code": "C3O9X",
40+
"environment": "prod",
41+
"created_on": "2024-12-11T11:18:53.532840+00:00",
42+
"updated_on": "2024-12-11T11:18:53.534066+00:00",
43+
"deleted_on": null,
44+
"keys": [
45+
{
46+
"key_type": "accredited_system_id",
47+
"key_value": "000000000001"
48+
}
49+
],
50+
"tags": [
51+
{
52+
"nhs_id_code": "C3O9X",
53+
"nhs_as_svc_ia": "urn:nhs:names:services:pdsquery:QUQI_IN010000UK14"
54+
},
55+
{
56+
"nhs_id_code": "C3O9X",
57+
"nhs_as_svc_ia": "urn:nhs:names:services:pdsquery:QUQI_IN010000UK14",
58+
"nhs_mhs_party_key": "C3O9X-806782"
59+
}
60+
],
61+
"questionnaire_responses": {
62+
"spine_as/1": [
63+
{
64+
"id": "07dacf01-359a-4276-9dd2-e11ecb07076a",
65+
"questionnaire_name": "spine_as",
66+
"questionnaire_version": "1",
67+
"data": {
68+
"Client ODS Codes": ["C3O9X"],
69+
"MHS Party Key": "C3O9X-806782",
70+
"ASID": "000000000001",
71+
"ODS Code": "C3O9X",
72+
"Temp UID": null,
73+
"Product Key": "6216",
74+
"Product Name": "TPP SystmOne",
75+
"Product Version": null,
76+
"Date Requested": "20091016133757",
77+
"Date Approved": "20091016133823",
78+
"Approver URP": "uniqueIdentifier=102583034545,uniqueIdentifier=352307522545,uid=432776896545,ou=People,o=nhs",
79+
"Requestor URP": "uniqueIdentifier=203171972540,uniqueIdentifier=352307522545,uid=432776896545,ou=People,o=nhs",
80+
"MHS Manufacturer Organisation": "C3O9X"
81+
},
82+
"created_on": "2024-12-11T11:18:53.456536+00:00"
83+
}
84+
]
85+
},
86+
"device_reference_data": {
87+
"390fc252-02a2-494e-b6fb-16717eec7168": ["*.Interaction ID"],
88+
"68cd98db-5d8d-45dc-ba9a-09e892535d83": ["*.Interaction ID"]
89+
}
90+
},
91+
{
92+
"id": "390fc252-02a2-494e-b6fb-16717eec7168",
93+
"name": "C3O9X-806782 - MHS Message Sets",
94+
"status": "active",
95+
"product_id": "P.9AN-PJG",
96+
"product_team_id": "C3O9X.fe49c1d5-d9bc-4c2e-8e8d-54d8e2e88250",
97+
"ods_code": "C3O9X",
98+
"environment": "prod",
99+
"questionnaire_responses": {},
100+
"created_on": "2024-12-11T11:18:53.452472+00:00",
101+
"updated_on": null,
102+
"deleted_on": null
103+
},
104+
{
105+
"id": "68cd98db-5d8d-45dc-ba9a-09e892535d83",
106+
"name": "C3O9X-806782 - AS Additional Interactions",
107+
"status": "active",
108+
"product_id": "P.9AN-PJG",
109+
"product_team_id": "C3O9X.fe49c1d5-d9bc-4c2e-8e8d-54d8e2e88250",
110+
"ods_code": "C3O9X",
111+
"environment": "prod",
112+
"questionnaire_responses": {
113+
"spine_as_additional_interactions/1": [
114+
{
115+
"id": "2071f8ac-a020-4bf3-b413-c205004bfb08",
116+
"questionnaire_name": "spine_as_additional_interactions",
117+
"questionnaire_version": "1",
118+
"data": {
119+
"Interaction ID": "urn:nhs:names:services:pdsquery:QUQI_IN010000UK14"
120+
},
121+
"created_on": "2024-12-11T11:18:53.409854+00:00"
122+
}
123+
]
124+
},
125+
"created_on": "2024-12-11T11:18:53.452472+00:00",
126+
"updated_on": "2024-12-11T11:18:53.452853+00:00",
127+
"deleted_on": null
128+
}
129+
]

src/etl/sds/tests/changelog/utils.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ def read_all(
150150
ADD_ACCREDITED_SYSTEM_IN_SAME_PRODUCT_AS_MHS = read_ldif(
151151
"add/accredited_system.SameProductAsMhs.ldif"
152152
)
153+
ADD_ACCREDITED_SYSTEM_WITH_ACF = read_ldif("add/accredited_system_with_acf.ldif")
153154
ADD_MESSAGE_HANDLING_SYSTEM = read_ldif("add/message_handling_system.ldif")
154155
ADD_ANOTHER_MESSAGE_HANDLING_SYSTEM = read_ldif(
155156
"add/message_handling_system.AnotherWithDifferentUniqueIdentifier.ldif"
@@ -232,3 +233,9 @@ def read_all(
232233
MODIFY_ACCREDITED_SYSTEM_REPLACE_DEVICE_FIELD = create_modify_ldif(
233234
"replace/nhs_approver_urp.ldif", device_type="accredited_system"
234235
)
236+
MODIFY_ACCREDITED_SYSTEM_REPLACE_DEVICE_LIST_FIELD_WITH_EMPTY = create_modify_ldif(
237+
"replace/nhs_as_acf.ldif", device_type="accredited_system"
238+
)
239+
MODIFY_ACCREDITED_SYSTEM_REPLACE_DEVICE_NON_LIST_FIELD_WITH_EMPTY = create_modify_ldif(
240+
"replace/nhs_temp_uid.ldif", device_type="accredited_system"
241+
)

0 commit comments

Comments
 (0)