diff --git a/src/primaite/simulator/sim_container.py b/src/primaite/simulator/sim_container.py index db8a718c..896861e6 100644 --- a/src/primaite/simulator/sim_container.py +++ b/src/primaite/simulator/sim_container.py @@ -60,4 +60,3 @@ class Simulation(SimComponent): """Apply a timestep to the simulation.""" super().apply_timestep(timestep) self.network.apply_timestep(timestep) - # self.domain.apply_timestep(timestep) diff --git a/tests/unit_tests/_primaite/_simulator/_system/_services/test_service_actions.py b/tests/unit_tests/_primaite/_simulator/_system/_services/test_service_actions.py index 6b2ee0a7..714644e4 100644 --- a/tests/unit_tests/_primaite/_simulator/_system/_services/test_service_actions.py +++ b/tests/unit_tests/_primaite/_simulator/_system/_services/test_service_actions.py @@ -78,3 +78,16 @@ def test_service_enable(service): service.apply_request(["enable"]) assert service.operating_state == ServiceOperatingState.STOPPED + + +def test_service_patch(service): + """Test that a service can be patched and that it takes two timesteps to complete.""" + service.start() + assert service.health_state_actual == SoftwareHealthState.GOOD + + service.apply_request(["patch"]) + assert service.health_state_actual == SoftwareHealthState.PATCHING + service.apply_timestep(1) + assert service.health_state_actual == SoftwareHealthState.PATCHING + service.apply_timestep(2) + assert service.health_state_actual == SoftwareHealthState.GOOD