From 62be66205cdbb91e43b3438eae396b660dff199c Mon Sep 17 00:00:00 2001 From: Marek Wolan Date: Thu, 31 Aug 2023 10:57:45 +0100 Subject: [PATCH] Fix unit tests --- .../_primaite/_simulator/_network/_hardware/test_nic.py | 2 +- tests/unit_tests/_primaite/_simulator/test_core.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/unit_tests/_primaite/_simulator/_network/_hardware/test_nic.py b/tests/unit_tests/_primaite/_simulator/_network/_hardware/test_nic.py index dc508508..c417b5b9 100644 --- a/tests/unit_tests/_primaite/_simulator/_network/_hardware/test_nic.py +++ b/tests/unit_tests/_primaite/_simulator/_network/_hardware/test_nic.py @@ -48,7 +48,7 @@ def test_nic_deserialize(): nic_json = nic.model_dump_json() deserialized_nic = NIC.model_validate_json(nic_json) - assert nic == deserialized_nic + assert nic_json == deserialized_nic.model_dump_json() def test_nic_ip_address_as_gateway_fails(): diff --git a/tests/unit_tests/_primaite/_simulator/test_core.py b/tests/unit_tests/_primaite/_simulator/test_core.py index 0d227633..bbb1298f 100644 --- a/tests/unit_tests/_primaite/_simulator/test_core.py +++ b/tests/unit_tests/_primaite/_simulator/test_core.py @@ -43,4 +43,5 @@ class TestIsolatedSimComponent: comp = TestComponent(name="computer", size=(5, 10)) dump = comp.model_dump_json() - assert comp == TestComponent.model_validate_json(dump) + reconstructed = TestComponent.model_validate_json(dump) + assert comp == reconstructed.model_dump_json()