Added tests for MasterMACS
This commit is contained in:
@@ -218,3 +218,7 @@ class SinqMotor(Motor):
|
||||
|
||||
class TurboPMAC(SinqMotor):
|
||||
pass
|
||||
|
||||
|
||||
class MasterMACS(SinqMotor):
|
||||
pass
|
||||
|
||||
@@ -30,7 +30,7 @@ pmacAsynIPPortConfigure("$(ASYN_PORT)","$(TURBOPMAC1_IP):$(TURBOPMAC1_PORT)")
|
||||
|
||||
turboPmacController("$(NAME)","$(ASYN_PORT)",8,$(TURBOPMAC1_BUSYPOLL),$(TURBOPMAC1_IDLEPOLL),1);
|
||||
turboPmacAxis("$(NAME)",1);
|
||||
turboPmacAxis("$(NAME)",5);
|
||||
#turboPmacAxis("$(NAME)",5);
|
||||
|
||||
# Set the number of subsequent timeouts
|
||||
setMaxSubsequentTimeouts("$(NAME)", 20);
|
||||
|
||||
@@ -6,15 +6,7 @@ def stop_reset_enable_move_sequence(motor, target):
|
||||
|
||||
motor.write_field('stop', 1)
|
||||
motor.write_field('reseterrorpv', 1)
|
||||
|
||||
# Wait until the motor is disabled.
|
||||
# motor.wait_disabled()
|
||||
|
||||
motor.write_field('enable', 1)
|
||||
|
||||
# Wait until the motor is enabled.
|
||||
# motor.wait_enabled()
|
||||
|
||||
motor.move_and_wait(target)
|
||||
assert motor.at_target(target)
|
||||
assert not motor.has_error()
|
||||
0
tests/sinqMotor/masterMacs/__init__.py
Normal file
0
tests/sinqMotor/masterMacs/__init__.py
Normal file
0
tests/sinqMotor/masterMacs/lin1/__init__.py
Normal file
0
tests/sinqMotor/masterMacs/lin1/__init__.py
Normal file
9
tests/sinqMotor/masterMacs/lin1/conftest.py
Normal file
9
tests/sinqMotor/masterMacs/lin1/conftest.py
Normal file
@@ -0,0 +1,9 @@
|
||||
# This module defines fixtures which are shared for all tests of motor "lin1".
|
||||
|
||||
import pytest
|
||||
from common import MasterMACS
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def motor():
|
||||
return MasterMACS('masterMacs1', 'lin1')
|
||||
34
tests/sinqMotor/masterMacs/lin1/test_common.py
Executable file
34
tests/sinqMotor/masterMacs/lin1/test_common.py
Executable file
@@ -0,0 +1,34 @@
|
||||
# Run a selection of common tests
|
||||
|
||||
from tests.move import *
|
||||
from tests.sinqMotor.limits import *
|
||||
from tests.sinqMotor.common import *
|
||||
from tests.sinqMotor.turboPmac.reset import reset
|
||||
|
||||
|
||||
def test_stop_reset_enable_move_sequence(motor):
|
||||
stop_reset_enable_move_sequence(motor, 4)
|
||||
stop_reset_enable_move_sequence(motor, 2)
|
||||
|
||||
|
||||
def test_move_to_low_limit_switch(motor):
|
||||
reset(motor, 1)
|
||||
move_to_low_limit_switch(motor)
|
||||
|
||||
|
||||
def test_move_to_high_limit_switch(motor):
|
||||
reset(motor, 1)
|
||||
move_to_high_limit_switch(motor)
|
||||
|
||||
|
||||
def test_move_while_move(motor):
|
||||
reset(motor, 1)
|
||||
move_while_move(motor, -60, -20)
|
||||
|
||||
|
||||
def test_stop(motor):
|
||||
reset(motor, 1)
|
||||
stop(motor, 18)
|
||||
|
||||
# def test_reread_limits_from_hw(motor):
|
||||
# reread_limits_from_hw(motor)
|
||||
@@ -1,4 +1,4 @@
|
||||
# This module defines fixtures which are shared for all tests of motor "rot1".
|
||||
# This module defines fixtures which are shared for all tests of motor "lin1".
|
||||
|
||||
import pytest
|
||||
from common import TurboPMAC
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
from tests.move import *
|
||||
from tests.sinqMotor.limits import *
|
||||
from tests.sinqMotor.turboPmac.common import *
|
||||
from tests.sinqMotor.common import *
|
||||
from tests.sinqMotor.turboPmac.reset import reset
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ def test_stop_reset_enable_move_sequence(motor):
|
||||
stop_reset_enable_move_sequence(motor, 5)
|
||||
stop_reset_enable_move_sequence(motor, 0)
|
||||
|
||||
|
||||
def test_move_to_low_limit_switch(motor):
|
||||
reset(motor)
|
||||
move_to_low_limit_switch(motor)
|
||||
|
||||
Reference in New Issue
Block a user