summaryrefslogtreecommitdiffstats
path: root/lab_control/test/jds6600_test.py
diff options
context:
space:
mode:
Diffstat (limited to 'lab_control/test/jds6600_test.py')
-rw-r--r--lab_control/test/jds6600_test.py33
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)