UT: Sort updated_machine.network_interfaces

This commit is contained in:
Mike Salvatore 2022-09-21 20:37:30 -04:00
parent 5b61767575
commit 284f58afaf
1 changed files with 3 additions and 5 deletions

View File

@ -222,14 +222,12 @@ def test_machine_interfaces_updated(handler, machine_repository):
IPv4Interface("192.168.1.4/24"), IPv4Interface("192.168.1.4/24"),
], ],
) )
expected_network_interfaces = tuple( expected_network_interfaces = sorted(
sorted(
(*agent_registration_data.network_interfaces, existing_machine.network_interfaces[-1]) (*agent_registration_data.network_interfaces, existing_machine.network_interfaces[-1])
) )
)
handler(agent_registration_data) handler(agent_registration_data)
updated_machine = machine_repository.upsert_machine.call_args_list[0][0][0] updated_machine = machine_repository.upsert_machine.call_args_list[0][0][0]
actual_network_interfaces = updated_machine.network_interfaces actual_network_interfaces = sorted(updated_machine.network_interfaces)
assert actual_network_interfaces == expected_network_interfaces assert actual_network_interfaces == expected_network_interfaces