Beispiel #1
0
 def test_set_output(self, output):
     # assemble
     with HCS3202(PORT) as device:
         # act
         result = device.set_output(output)
     # assert
     assert result
Beispiel #2
0
 def test_set_current(self, current):
     # assemble
     with HCS3202(PORT) as device:
         # act
         result = device.set_current(current)
     # assert
     assert result
Beispiel #3
0
 def test_disable(self):
     # assemble
     with HCS3202(PORT) as device:
         # act
         result = device.disable()
     # assert
     assert result
Beispiel #4
0
 def test_set_voltage(self, voltage):
     # assemble
     with HCS3202(PORT) as device:
         # act
         result = device.set_voltage(voltage)
     # assert
     assert result
Beispiel #5
0
 def test_set_get_current(self):
     # assemble
     with HCS3202(PORT) as device:
         # act
         target_current = 0.5
         result = device.set_current(target_current)
         voltage, current = device.get_preset()
     # assert
     assert current == target_current
Beispiel #6
0
 def test_set_get_voltage(self):
     # assemble
     with HCS3202(PORT) as device:
         # act
         target_voltage = 12.0
         result = device.set_voltage(target_voltage)
         voltage, current = device.get_preset()
     # assert
     assert voltage == target_voltage
Beispiel #7
0
 def test_get_display(self):
     # assemble
     with HCS3202(PORT) as device:
         # act
         voltage, current, cv = device.get_display()
Beispiel #8
0
 def test_get_preset(self):
     # assemble
     with HCS3202(PORT) as device:
         # act
         voltage, current = device.get_preset()
Beispiel #9
0
 def test_set_over(self):
     # assemble
     with HCS3202(PORT, max_current=1) as device:
         # act & assert
         with pytest.raises(AssertionError, match=r"^Invalid.*"):
             result = device.set_current(90)
Beispiel #10
0
 def test_set_negative(self):
     # assemble
     with HCS3202(PORT) as device:
         # act & assert
         with pytest.raises(AssertionError, match=r"^Negative.*"):
             result = device.set_current(-1)