Skip to content

Commit

Permalink
[feature/PI-605-bulk_etl_transform] fix up asids
Browse files Browse the repository at this point in the history
  • Loading branch information
jaklinger committed Nov 25, 2024
1 parent 8e3cf6f commit e4f5e85
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -28,29 +28,23 @@ 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,
product_id=device.product_id,
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"),
]


Expand All @@ -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)
Expand Down

0 comments on commit e4f5e85

Please sign in to comment.