fix(test-mo1-bragg): fix test for mo1_bragg mov succeeds.
This commit is contained in:
@@ -74,15 +74,16 @@ def test_egu(mock_bragg):
|
||||
def test_move_succeeds(mock_bragg):
|
||||
dev = mock_bragg
|
||||
dev.move_abs._read_pv.mock_data = 0
|
||||
# Move succeeds
|
||||
with mock.patch.object(dev.motor_is_moving._read_pv, "mock_data", side_effect=[0, 1]):
|
||||
status = dev.move(0.5)
|
||||
# Sleep needed to allow thread to resolive in _move_and_finish, i.e. and the 0.25s sleep inside the function
|
||||
time.sleep(1)
|
||||
assert status.done is True
|
||||
assert status.success is True
|
||||
assert dev.setpoint.get() == 0.5
|
||||
assert dev.move_abs.get() == 1
|
||||
dev.motor_is_moving._read_pv.mock_data = 0
|
||||
|
||||
status = dev.move(0.5)
|
||||
assert status.done is False
|
||||
dev.motor_is_moving._read_pv.mock_data = 1
|
||||
status.wait(timeout=3) # Callback should within that time
|
||||
assert status.done is True
|
||||
assert status.success is True
|
||||
assert dev.setpoint.get() == 0.5
|
||||
assert dev.move_abs.get() == 1
|
||||
|
||||
|
||||
def test_stop_move(mock_bragg):
|
||||
|
||||
Reference in New Issue
Block a user