From e4f5e85c824690fe07f90acc2bb833ed1a10009e Mon Sep 17 00:00:00 2001 From: Joel Klinger Date: Mon, 25 Nov 2024 10:39:41 +0000 Subject: [PATCH] [feature/PI-605-bulk_etl_transform] fix up asids --- .../device_repository/tests/v1/conftest.py | 8 +++----- .../tests/v1/test_device_repository_keys_v1.py | 18 ++++++------------ 2 files changed, 9 insertions(+), 17 deletions(-) diff --git a/src/layers/domain/repository/device_repository/tests/v1/conftest.py b/src/layers/domain/repository/device_repository/tests/v1/conftest.py index a206147f4..13dff0c21 100644 --- a/src/layers/domain/repository/device_repository/tests/v1/conftest.py +++ b/src/layers/domain/repository/device_repository/tests/v1/conftest.py @@ -37,9 +37,7 @@ def device_with_asid() -> Device: device = product.create_device(name="Device-1") device.add_tag(foo="bar", abc="123") device.add_tag(bar="foo") - device.add_key( - key_value="ABC:1234567890", key_type=DeviceKeyType.ACCREDITED_SYSTEM_ID - ) + device.add_key(key_value="1234567890", key_type=DeviceKeyType.ACCREDITED_SYSTEM_ID) device.add_key(key_value="P.WWW-CCC", key_type=DeviceKeyType.PRODUCT_ID) return device @@ -52,8 +50,8 @@ def device_with_mhs_id() -> Device: device = product.create_device(name="Device-2") device.add_key(key_value="P.WWW-YYY", key_type=DeviceKeyType.PRODUCT_ID) device.add_key( - key_value="ABC:DEF-444:4444444444", - key_type=DeviceKeyType.MESSAGE_HANDLING_SYSTEM_ID, + key_value="123456", + key_type=DeviceKeyType.CPA_ID, ) device.add_tag(abc="123") device.add_tag(bar="foo") diff --git a/src/layers/domain/repository/device_repository/tests/v1/test_device_repository_keys_v1.py b/src/layers/domain/repository/device_repository/tests/v1/test_device_repository_keys_v1.py index 94727e2b3..63abce14b 100644 --- a/src/layers/domain/repository/device_repository/tests/v1/test_device_repository_keys_v1.py +++ b/src/layers/domain/repository/device_repository/tests/v1/test_device_repository_keys_v1.py @@ -17,7 +17,7 @@ def test__device_repository__add_two_keys(device: Device, repository: DeviceRepo id=device.id, ) second_device.add_key( - key_value="ABC:1234567890", key_type=DeviceKeyType.ACCREDITED_SYSTEM_ID + key_value="1234567890", key_type=DeviceKeyType.ACCREDITED_SYSTEM_ID ) repository.write(second_device) time.sleep(1) @@ -28,9 +28,7 @@ def test__device_repository__add_two_keys(device: Device, repository: DeviceRepo id=device.id, ).keys == [ DeviceKey(key_type=DeviceKeyType.PRODUCT_ID, key_value="P.WWW-XXX"), - DeviceKey( - key_type=DeviceKeyType.ACCREDITED_SYSTEM_ID, key_value="ABC:1234567890" - ), + DeviceKey(key_type=DeviceKeyType.ACCREDITED_SYSTEM_ID, key_value="1234567890"), ] assert repository.read( product_team_id=device.product_team_id, @@ -38,19 +36,15 @@ def test__device_repository__add_two_keys(device: Device, repository: DeviceRepo id="P.WWW-XXX", ).keys == [ DeviceKey(key_type=DeviceKeyType.PRODUCT_ID, key_value="P.WWW-XXX"), - DeviceKey( - key_type=DeviceKeyType.ACCREDITED_SYSTEM_ID, key_value="ABC:1234567890" - ), + DeviceKey(key_type=DeviceKeyType.ACCREDITED_SYSTEM_ID, key_value="1234567890"), ] assert repository.read( product_team_id=device.product_team_id, product_id=device.product_id, - id="ABC:1234567890", + id="1234567890", ).keys == [ DeviceKey(key_type=DeviceKeyType.PRODUCT_ID, key_value="P.WWW-XXX"), - DeviceKey( - key_type=DeviceKeyType.ACCREDITED_SYSTEM_ID, key_value="ABC:1234567890" - ), + DeviceKey(key_type=DeviceKeyType.ACCREDITED_SYSTEM_ID, key_value="1234567890"), ] @@ -69,7 +63,7 @@ def test__device_repository__delete_key( id=device_with_asid.id, ) intermediate_device.delete_key( - key_type=DeviceKeyType.ACCREDITED_SYSTEM_ID, key_value="ABC:1234567890" + key_type=DeviceKeyType.ACCREDITED_SYSTEM_ID, key_value="1234567890" ) repository.write(intermediate_device) time.sleep(1)