To receive notifications about scheduled maintenance, please subscribe to the mailing-list gitlab-operations@sympa.ethz.ch. You can subscribe to the mailing-list at https://sympa.ethz.ch

Commit d571be80 authored by Henrik Menne's avatar Henrik Menne
Browse files

tests

parent 686404be
Pipeline #53092 failed with stages
in 3 minutes and 47 seconds
......@@ -89,10 +89,10 @@ def test_get_ain(started_dev_comm):
def test_set_ain_range(started_dev_comm):
lj, com = started_dev_comm
lj.set_ain_range(0, 10)
lj.set_ain_range(0, lj.AInRange.TEN)
assert com.get_written() == ("AIN0_RANGE", 10)
lj.set_ain_range(0, 0.1)
lj.set_ain_range(0, lj.AInRange.ONE_TENTH)
assert com.get_written() == ("AIN0_RANGE", 0.1)
with pytest.raises(LabJackError):
......@@ -143,19 +143,19 @@ def test_set_ain_thermocouple(started_dev_comm_with_t7pro):
lj, com = started_dev_comm_with_t7pro
lj.set_ain_thermocouple(0, None)
lj.set_ain_thermocouple(0, LabJack.ThermocoupleType.NONE)
lj.set_ain_thermocouple(0, lj.ThermocoupleType.NONE)
lj.set_ain_thermocouple(0, "K")
lj.set_ain_thermocouple(0, LabJack.ThermocoupleType.K)
lj.set_ain_thermocouple(0, lj.ThermocoupleType.K)
with pytest.raises(ValueError):
lj.set_ain_thermocouple(0, "B")
lj.set_ain_thermocouple(0, thermocouple="T", unit="F")
lj.set_ain_thermocouple(0, thermocouple="T", unit=LabJack.TemperatureUnit.F)
lj.set_ain_thermocouple(0, thermocouple="T", unit=lj.TemperatureUnit.F)
with pytest.raises(ValueError):
lj.set_ain_thermocouple(0, "K", unit="B")
lj.set_ain_thermocouple(0, thermocouple="T", cjc_type="lm34")
lj.set_ain_thermocouple(0, thermocouple="T", cjc_type=LabJack.CjcType.lm34)
lj.set_ain_thermocouple(0, thermocouple="T", cjc_type=lj.CjcType.lm34)
with pytest.raises(ValueError):
lj.set_ain_thermocouple(0, "K", cjc_type="LM35")
......@@ -228,10 +228,10 @@ def test_get_cal_current_source(started_dev_comm):
def test_get_digital_input(started_dev_comm_with_t4):
lj, com = started_dev_comm_with_t4
com.put_name("EIO0", LabJack.DIOStatus.LOW)
assert lj.get_digital_input("EIO0") == LabJack.DIOStatus.LOW
com.put_name("EIO0", LabJack.DIOStatus.HIGH)
assert lj.get_digital_input("EIO0") == LabJack.DIOStatus.HIGH
com.put_name("EIO0", lj.DIOStatus.LOW)
assert lj.get_digital_input("EIO0") == lj.DIOStatus.LOW
com.put_name("EIO0", lj.DIOStatus.HIGH)
assert lj.get_digital_input("EIO0") == lj.DIOStatus.HIGH
com.put_name("EIO0", 2.0)
with pytest.raises(LabJackIdentifierDIOError):
lj.get_digital_input("EIO0")
......@@ -248,8 +248,8 @@ def test_get_digital_input(started_dev_comm_with_t4):
def test_set_digital_output(started_dev_comm_with_t7pro):
lj, com = started_dev_comm_with_t7pro
lj.set_digital_output("FIO0", LabJack.DIOStatus.HIGH)
assert com.get_written() == ("FIO0", LabJack.DIOStatus.HIGH)
lj.set_digital_output("FIO0", lj.DIOStatus.HIGH)
assert com.get_written() == ("FIO0", lj.DIOStatus.HIGH)
with pytest.raises(LabJackIdentifierDIOError):
lj.set_digital_output("AIO0", 1)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment