Skip to content

Commit

Permalink
Add unit tests for the new MTCS.m1m3_in_engineering_mode context mana…
Browse files Browse the repository at this point in the history
…ger.
  • Loading branch information
tribeiro authored and edennihy committed Dec 13, 2024
1 parent 21b18b3 commit 18ea8fa
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/maintel/test_mtcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -2455,3 +2455,22 @@ async def assert_m1m3_slew_settings_applied(
assert (
actual_settings[setting] == expected_value
), f"Setting {setting} expected to be {expected_value} but was {actual_settings[setting]}"

async def test_m1m3_in_engineering_mode(self) -> None:

async with self.mtcs.m1m3_in_engineering_mode():
await asyncio.sleep(0)

self.mtcs.rem.mtm1m3.cmd_enterEngineering.start.assert_awaited_once()
self.mtcs.rem.mtm1m3.cmd_exitEngineering.start.assert_awaited_once()

async def test_m1m3_in_engineering_mode_with_failed_op(self) -> None:

try:
async with self.mtcs.m1m3_in_engineering_mode():
raise RuntimeError("This is a test.")
except RuntimeError:
pass

self.mtcs.rem.mtm1m3.cmd_enterEngineering.start.assert_awaited_once()
self.mtcs.rem.mtm1m3.cmd_exitEngineering.start.assert_awaited_once()

0 comments on commit 18ea8fa

Please sign in to comment.