diff options
author | Eddy Pedroni <eddy@0xf7.com> | 2022-05-29 19:20:09 +0200 |
---|---|---|
committer | Eddy Pedroni <eddy@0xf7.com> | 2022-05-29 19:20:09 +0200 |
commit | a0783e9f9698b3370c96eaab574d433e25372bc7 (patch) | |
tree | 265540f0beb122edff0688293a968067e14c545c /lab_control/test/jds6600_test.py | |
parent | 8d4621a92e58b1466010f2ad3aeada5e04a453b2 (diff) |
Added JDS6600 initial implementation, test device doesn't work
Diffstat (limited to 'lab_control/test/jds6600_test.py')
-rw-r--r-- | lab_control/test/jds6600_test.py | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/lab_control/test/jds6600_test.py b/lab_control/test/jds6600_test.py new file mode 100644 index 0000000..45f841a --- /dev/null +++ b/lab_control/test/jds6600_test.py @@ -0,0 +1,33 @@ +import pytest + +from lab_control.jds6600 import JDS6600 +from lab_control.test.mock_jds6600_device import MockJDS6600Device + +AVAILABLE_CHANNELS = [1, 2] + +@pytest.fixture +def mockDevice(): + d = MockJDS6600Device() + yield d + d.stop() + +@pytest.fixture +def uut(mockDevice): + uut = JDS6600(mockDevice.getPortName()) + yield uut + print("Cleaning up UUT") + +def tes_serialConfiguration(mockDevice): + with pytest.raises(AssertionError): + mockDevice.checkPortConfiguration() + + uut = JDS6600(mockDevice.getPortName()) + mockDevice.checkPortConfiguration() + +def test_channelOnAndOff(uut, mockDevice): + for ch in AVAILABLE_CHANNELS: + assert not mockDevice.isOn(ch) + #uut.setOn(ch) + #assert mockDevice.isOn(ch) + #uut.setOff(ch) + #assert not mockDevice.isOn(ch) |