diff --git a/devices/integration_test/devices/test_device_apsct.py b/devices/integration_test/devices/test_device_apsct.py index f26bdd26ea1a8df8f36a1e9ccf97d6c80d7cd297..8d2d384b7405d15253ffd68e2bbc287a20a6cecb 100644 --- a/devices/integration_test/devices/test_device_apsct.py +++ b/devices/integration_test/devices/test_device_apsct.py @@ -7,6 +7,8 @@ # Distributed under the terms of the APACHE license. # See LICENSE.txt for more info. +import time + from tango import DeviceProxy from tango._tango import DevState @@ -18,6 +20,16 @@ class TestDeviceAPSCT(base.IntegrationTestCase): def setUp(self): super(TestDeviceAPSCT, self).setUp() + def tearDown(self): + """Turn device Off in teardown to prevent blocking tests""" + d = DeviceProxy("LTS/PCC/1") + + try: + d.Off() + except Exception as e: + """Failing to turn Off devices should not raise errors here""" + print("Failed to turn device off in teardown %s" % e) + def test_device_proxy_apsct(self): """Test if we can successfully create a DeviceProxy and fetch state""" @@ -25,3 +37,27 @@ class TestDeviceAPSCT(base.IntegrationTestCase): d = DeviceProxy("LTS/PCC/1") self.assertEqual(DevState.OFF, d.state()) + + def test_device_apsct_initialize(self): + """Test if we can transition to standby""" + + # TODO(Corne): Change name to APSCT once ready + d = DeviceProxy("LTS/PCC/1") + + d.initialise() + time.sleep(1) + + self.assertEqual(DevState.STANDBY, d.state()) + + def test_device_apsct_on(self): + """Test if we can transition to on""" + + # TODO(Corne): Change name to APSCT once ready + d = DeviceProxy("LTS/PCC/1") + + d.initialise() + time.sleep(1) + + d.on() + + self.assertEqual(DevState.ON, d.state()) diff --git a/devices/integration_test/devices/test_device_sdp.py b/devices/integration_test/devices/test_device_sdp.py index 89a30acca228e255810cec2f644b730e0c0f1694..040df6c1021fb270590d46072f9269e54ff3665a 100644 --- a/devices/integration_test/devices/test_device_sdp.py +++ b/devices/integration_test/devices/test_device_sdp.py @@ -7,6 +7,8 @@ # Distributed under the terms of the APACHE license. # See LICENSE.txt for more info. +import time + from tango import DeviceProxy from tango._tango import DevState @@ -16,11 +18,44 @@ from integration_test import base class TestDeviceSDP(base.IntegrationTestCase): def setUp(self): + """Intentionally recreate the device object in each test""" super(TestDeviceSDP, self).setUp() + def tearDown(self): + """Turn device Off in teardown to prevent blocking tests""" + d = DeviceProxy("LTS/SDP/1") + + try: + d.Off() + except Exception as e: + """Failing to turn Off devices should not raise errors here""" + print("Failed to turn device off in teardown %s" % e) + def test_device_proxy_sdp(self): """Test if we can successfully create a DeviceProxy and fetch state""" d = DeviceProxy("LTS/SDP/1") self.assertEqual(DevState.OFF, d.state()) + + def test_device_sdp_initialize(self): + """Test if we can transition to standby""" + + d = DeviceProxy("LTS/SDP/1") + + d.initialise() + time.sleep(1) + + self.assertEqual(DevState.STANDBY, d.state()) + + def test_device_sdp_on(self): + """Test if we can transition to on""" + + d = DeviceProxy("LTS/SDP/1") + + d.initialise() + time.sleep(1) + + d.on() + + self.assertEqual(DevState.ON, d.state())