Add unit test
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user