Skip to content

Commit

Permalink
Address PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
isotuela committed Jul 18, 2023
1 parent 766b54f commit e28128c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@


class PowerOffATCalSys(salobj.BaseScript):
"""Powers on the ATCalSys dome flat illuminator
"""Powers off the ATCalSys dome flat illuminator
turning white lamp off, closing the shutter and
stopping the chiller.
Expand Down Expand Up @@ -121,7 +121,6 @@ async def wait_for_lamp_to_cool_down(self):
f"Lamp state: {ATWhiteLight.LampBasicState(lamp_state.basicState)!r}."
f"Need to wait {cool_down_wait_time/60} min"
)
asyncio.sleep(60)
except asyncio.TimeoutError:
raise RuntimeError(
f"White Light Lamp failed to turn off after {self.timeout_lamp_warm_up} s."
Expand All @@ -134,9 +133,8 @@ async def assert_components_enabled(self):
------
RunTimeError:
If ATWhiteLight is not ENABLED"""
for comp in [self.white_light_source]:
summary_state = await comp.evt_summaryState.aget()
if salobj.State(summary_state.summaryState) != salobj.State(
salobj.State.ENABLED
):
raise RuntimeError(f"{comp} is not ENABLED")
summary_state = await self.white_light_source.evt_summaryState.aget(
timeout=self.cmd_timeout
)
if summary_state.summaryState != salobj.State.ENABLED:
raise RuntimeError("ATWhiteLight is not ENABLED")
4 changes: 3 additions & 1 deletion tests/test_auxtel_power_off_atcalsys.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,9 @@ async def test_run_without_without_failures(self):
await self.run_script()

# Summary State
self.script.white_light_source.evt_summaryState.aget.assert_awaited_once()
self.script.white_light_source.evt_summaryState.aget.assert_awaited_once_with(
timeout=self.script.cmd_timeout
)

# White lamp
self.script.white_light_source.cmd_turnLampOff.start.assert_awaited_with(
Expand Down

0 comments on commit e28128c

Please sign in to comment.