"""A thermal SET after a motion must not replay that motion selection.""" import sys import unittest from pathlib import Path sys.path.insert(0, str(Path(__file__).resolve().parents[2] / "tools")) from prod2u_gui import reset_motor_actions class Value: def __init__(self, value): self.value = value def set(self, value): self.value = value class MotionActionTests(unittest.TestCase): def test_only_actions_reset_after_transmission(self): slots = [{"action_var": Value(action), "steps_var": Value("123"), "half_var": Value("1000")} for action in ("PUSH_UP", "PUSH_DOWN", "STOP_CLEAR", "NOTHING")] reset_motor_actions(slots) self.assertEqual([s["action_var"].value for s in slots], ["NOTHING"] * 4) self.assertEqual([s["steps_var"].value for s in slots], ["123"] * 4) self.assertEqual([s["half_var"].value for s in slots], ["1000"] * 4) if __name__ == "__main__": unittest.main()