5
5
from artiq .devices .thorlabs_tcube .driver import Tdc , Tpz , TdcSim , TpzSim
6
6
from artiq .language .units import V
7
7
8
+
8
9
no_hardware = bool (os .getenv ("ARTIQ_NO_HARDWARE" ))
9
10
10
11
11
- class GenericTdcTest ( unittest . TestCase ) :
12
+ class GenericTdcTest :
12
13
def test_pot_parameters (self ):
13
14
test_vector = 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8
14
15
self .cont .set_pot_parameters (* test_vector )
@@ -82,14 +83,13 @@ def test_button_parameters(self):
82
83
self .assertEqual (test_vector , self .cont .get_button_parameters ())
83
84
84
85
85
- class GenericTpzTest ( unittest . TestCase ) :
86
+ class GenericTpzTest :
86
87
def test_position_control_mode (self ):
87
88
test_vector = 1
88
89
self .cont .set_position_control_mode (test_vector )
89
90
self .assertEqual (test_vector , self .cont .get_position_control_mode ())
90
91
91
92
def test_ouput_volts (self ):
92
-
93
93
for voltage in 5 * V , 10 * V , 15 * V , \
94
94
round (self .cont .get_tpz_io_settings ()[0 ].amount )* V :
95
95
with self .subTest (voltage = voltage ):
@@ -135,7 +135,7 @@ def test_tpz_io_settings(self):
135
135
136
136
137
137
@unittest .skipIf (no_hardware , "no hardware" )
138
- class TestTdc (GenericTdcTest ):
138
+ class TestTdc (unittest . TestCase , GenericTdcTest ):
139
139
def setUp (self ):
140
140
serial = os .getenv ("ARTIQ_TDC001_SERIAL" )
141
141
args = dict ()
@@ -144,13 +144,13 @@ def setUp(self):
144
144
self .cont = Tdc (** args )
145
145
146
146
147
- class TestTdcSim (GenericTdcTest ):
147
+ class TestTdcSim (unittest . TestCase , GenericTdcTest ):
148
148
def setUp (self ):
149
149
self .cont = TdcSim ()
150
150
151
151
152
152
@unittest .skipIf (no_hardware , "no hardware" )
153
- class TestTpz (GenericTpzTest ):
153
+ class TestTpz (unittest . TestCase , GenericTpzTest ):
154
154
def setUp (self ):
155
155
serial = os .getenv ("ARTIQ_TPZ001_SERIAL" )
156
156
args = dict ()
@@ -159,6 +159,6 @@ def setUp(self):
159
159
self .cont = Tpz (** args )
160
160
161
161
162
- class TestTpzSim (GenericTpzTest ):
162
+ class TestTpzSim (unittest . TestCase , GenericTpzTest ):
163
163
def setUp (self ):
164
164
self .cont = TpzSim ()
0 commit comments