Skip to content

Commit 3a38de2

Browse files
committed
fix tests for plan_stubs/wrapped
1 parent 0712e3d commit 3a38de2

File tree

1 file changed

+21
-19
lines changed

1 file changed

+21
-19
lines changed

tests/plan_stubs/test_wrapped_stubs.py

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -36,56 +36,58 @@ def y_axis() -> SimMotor:
3636

3737

3838
def test_set_absolute(x_axis: SimMotor):
39-
assert list(set_absolute(x_axis, 0.5)) == [Msg("set", x_axis, 0.5, group=None)]
39+
msgs = list(set_absolute(x_axis, 0.5, wait=True))
40+
assert len(msgs) == 2
41+
assert msgs[0] == Msg("set", x_axis, 0.5, group=ANY)
42+
assert msgs[1] == Msg("wait", group=msgs[0].kwargs["group"])
4043

4144

42-
def test_set_absolute_with_group(x_axis: SimMotor):
43-
assert list(set_absolute(x_axis, 0.5, group="foo")) == [
44-
Msg("set", x_axis, 0.5, group="foo")
45+
def test_set_absolute_without_wait(x_axis: SimMotor):
46+
assert list(set_absolute(x_axis, 0.5, wait=False)) == [
47+
Msg("set", x_axis, 0.5, group=None)
4548
]
4649

4750

48-
def test_set_absolute_with_wait(x_axis: SimMotor):
49-
msgs = list(set_absolute(x_axis, 0.5, wait=True))
51+
def test_set_absolute_with_group(x_axis: SimMotor):
52+
msgs = list(set_absolute(x_axis, 0.5, group="foo"))
5053
assert len(msgs) == 2
51-
assert msgs[0] == Msg("set", x_axis, 0.5, group=ANY)
54+
assert msgs[0] == Msg("set", x_axis, 0.5, group="foo")
5255
assert msgs[1] == Msg("wait", group=msgs[0].kwargs["group"])
5356

5457

55-
def test_set_absolute_with_group_and_wait(x_axis: SimMotor):
56-
assert list(set_absolute(x_axis, 0.5, group="foo", wait=True)) == [
57-
Msg("set", x_axis, 0.5, group="foo"),
58-
Msg("wait", group="foo"),
58+
def test_set_absolute_with_group_and_without_wait(x_axis: SimMotor):
59+
assert list(set_absolute(x_axis, 0.5, group="foo", wait=False)) == [
60+
Msg("set", x_axis, 0.5, group="foo")
5961
]
6062

6163

6264
def test_set_relative(x_axis: SimMotor):
6365
assert list(set_relative(x_axis, 0.5)) == [
6466
Msg("locate", x_axis),
65-
Msg("set", x_axis, 0.5, group=None),
67+
Msg("set", x_axis, 0.5, group=ANY),
68+
Msg("wait", group=ANY),
6669
]
6770

6871

6972
def test_set_relative_with_group(x_axis: SimMotor):
7073
assert list(set_relative(x_axis, 0.5, group="foo")) == [
7174
Msg("locate", x_axis),
7275
Msg("set", x_axis, 0.5, group="foo"),
76+
Msg("wait", group="foo"),
7377
]
7478

7579

76-
def test_set_relative_with_wait(x_axis: SimMotor):
77-
msgs = list(set_relative(x_axis, 0.5, wait=True))
78-
assert len(msgs) == 3
80+
def test_set_relative_without_wait(x_axis: SimMotor):
81+
msgs = list(set_relative(x_axis, 0.5, wait=False))
82+
assert len(msgs) == 2
7983
assert msgs[0] == Msg("locate", x_axis)
8084
assert msgs[1] == Msg("set", x_axis, 0.5, group=ANY)
81-
assert msgs[2] == Msg("wait", group=msgs[1].kwargs["group"])
8285

8386

84-
def test_set_relative_with_group_and_wait(x_axis: SimMotor):
85-
assert list(set_relative(x_axis, 0.5, group="foo", wait=True)) == [
87+
def test_set_relative_with_group_and_without_wait(x_axis: SimMotor):
88+
assert list(set_relative(x_axis, 0.5, group="foo", wait=False)) == [
8689
Msg("locate", x_axis),
8790
Msg("set", x_axis, 0.5, group="foo"),
88-
Msg("wait", group="foo"),
8991
]
9092

9193

0 commit comments

Comments
 (0)