Skip to content

Commit

Permalink
[feature/PI-618-bulk_etl] fix up tests after tag changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jaklinger committed Dec 3, 2024
1 parent 44d1bf7 commit 14008d5
Show file tree
Hide file tree
Showing 8 changed files with 90 additions and 368 deletions.
6 changes: 3 additions & 3 deletions src/layers/domain/api/sds/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ class SearchSDSDeviceQueryParams(BaseModel, extra=Extra.forbid):
nhs_mhs_manufacturer_org: str = None
nhs_mhs_party_key: str = None

@root_validator
def client_to_id(cls, values):
nhs_as_client = values.get("nhs_as_client")
@root_validator(pre=True)
def client_to_id(cls, values: dict):
nhs_as_client = values.pop("nhs_as_client", None)
nhs_id_code = values.get("nhs_id_code")
if nhs_as_client and not nhs_id_code:
values["nhs_id_code"] = nhs_as_client
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def test_party_key_generator_validate_key_valid():
[
"ABC000124", # Missing hyphen
"ABC-1234", # Number part too short
"ABC-1234567", # Number part too long
"ABC-123456789101112", # Number part too long
"ABC-0001A4", # Number part contains a non-digit character
"", # Empty string
],
Expand Down
4 changes: 2 additions & 2 deletions src/layers/etl_utils/ldif/tests/test_ldif.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@
myOtherField: 123
"""

FILTERED_AND_GROUPED_LDIF_TO_FILTER_AND_GROUP_EXAMPLE = """
FILTERED_AND_GROUPED_LDIF_TO_FILTER_AND_GROUP_EXAMPLE_BASE_64 = """
dn: uniqueIdentifier=AAA1
myField:: QUFB
myOtherField: 123
Expand Down Expand Up @@ -453,7 +453,7 @@ def test_filter_and_group_ldif_from_s3_by_property_with_b64encoded_group(mocked_
)
assert (
"".join(data.tobytes().decode() for data in filtered_ldif)
== FILTERED_AND_GROUPED_LDIF_TO_FILTER_AND_GROUP_EXAMPLE
== FILTERED_AND_GROUPED_LDIF_TO_FILTER_AND_GROUP_EXAMPLE_BASE_64
)


Expand Down
2 changes: 1 addition & 1 deletion src/layers/sds/epr/bulk_create/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def accredited_system_2() -> NhsMhs:
nhsrequestorurp="requester-456",
nhsdaterequested="a week ago",
nhsdateapproved="today",
nhsidcode="AAA",
nhsidcode="BBB",
nhsmhspartykey="AAA-456789",
nhsproductkey="key-123",
nhsasclient={"ABC", "JKL", "LMN"},
Expand Down
Loading

0 comments on commit 14008d5

Please sign in to comment.