Skip to content

Commit 7c102ce

Browse files
committed
Fixed some bugs in the tests
emulated query response in _query_configure_sequence_effect was not correct misuse of itertools.repeat caused test_configure_pulse_sequence to not behave as expected
1 parent eabcc53 commit 7c102ce

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

tests/sink_test.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ def test_set_state(self):
2626
@staticmethod
2727
def _query_configure_sequence_effect(steps: list, cmd: str):
2828
idx = int(cmd.split()[-1])
29-
return steps[idx - 1].current
29+
selected_step = steps[idx - 1]
30+
return f"{selected_step.current},{int(selected_step.trigger)}"
3031

3132
def test_configure_sequence(self):
3233

@@ -91,9 +92,9 @@ def test_configure_pulse_sequence(self, configure_seq_mock: MagicMock):
9192

9293
steps = list(
9394
itertools.chain(
94-
itertools.repeat(self.inst.SequenceStep(0), 10),
95-
itertools.repeat(self.inst.SequenceStep(10), 10),
96-
itertools.repeat(self.inst.SequenceStep(0), 1),
95+
(self.inst.SequenceStep(0) for _ in range(10)),
96+
(self.inst.SequenceStep(10) for _ in range(10)),
97+
(self.inst.SequenceStep(0) for _ in range(1)),
9798
)
9899
)
99100
steps[13].trigger = True

0 commit comments

Comments
 (0)