def test_set_output(self, output): # assemble with HCS3202(PORT) as device: # act result = device.set_output(output) # assert assert result
def test_set_current(self, current): # assemble with HCS3202(PORT) as device: # act result = device.set_current(current) # assert assert result
def test_disable(self): # assemble with HCS3202(PORT) as device: # act result = device.disable() # assert assert result
def test_set_voltage(self, voltage): # assemble with HCS3202(PORT) as device: # act result = device.set_voltage(voltage) # assert assert result
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
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
def test_get_display(self): # assemble with HCS3202(PORT) as device: # act voltage, current, cv = device.get_display()
def test_get_preset(self): # assemble with HCS3202(PORT) as device: # act voltage, current = device.get_preset()
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)
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)