diff --git a/tangostationcontrol/tangostationcontrol/integration_test/device_proxy.py b/tangostationcontrol/tangostationcontrol/integration_test/device_proxy.py new file mode 100644 index 0000000000000000000000000000000000000000..00ba0904c7bd01fa2ce1453a4c6701d6a4246e14 --- /dev/null +++ b/tangostationcontrol/tangostationcontrol/integration_test/device_proxy.py @@ -0,0 +1,8 @@ +from tango import DeviceProxy + + +class TestDeviceProxy(DeviceProxy): + + def __init__(self, *args, **kwargs): + super(TestDeviceProxy, self).__init__(*args, **kwargs) + self.set_timeout_millis(10000) diff --git a/tangostationcontrol/tangostationcontrol/integration_test/devices/test_device_recv.py b/tangostationcontrol/tangostationcontrol/integration_test/devices/test_device_recv.py index 68ac9bce1e4fa1e925af1f4738dd3b958d01cda3..6e6e8602e0662750b7b097c4e60f7fef0ce056a2 100644 --- a/tangostationcontrol/tangostationcontrol/integration_test/devices/test_device_recv.py +++ b/tangostationcontrol/tangostationcontrol/integration_test/devices/test_device_recv.py @@ -7,9 +7,9 @@ # Distributed under the terms of the APACHE license. # See LICENSE.txt for more info. -from tango import DeviceProxy from tango._tango import DevState +from tangostationcontrol.integration_test.device_proxy import TestDeviceProxy from tangostationcontrol.integration_test import base @@ -20,7 +20,7 @@ class TestDeviceRECV(base.IntegrationTestCase): def tearDown(self): """Turn device Off in teardown to prevent blocking tests""" - d = DeviceProxy("LTS/RECV/1") + d = TestDeviceProxy("LTS/RECV/1") try: d.Off() @@ -31,14 +31,14 @@ class TestDeviceRECV(base.IntegrationTestCase): def test_device_proxy_recv(self): """Test if we can successfully create a DeviceProxy and fetch state""" - d = DeviceProxy("LTS/RECV/1") + d = TestDeviceProxy("LTS/RECV/1") self.assertEqual(DevState.OFF, d.state()) def test_device_recv_initialize(self): """Test if we can transition to standby""" - d = DeviceProxy("LTS/RECV/1") + d = TestDeviceProxy("LTS/RECV/1") d.Initialise() @@ -47,7 +47,7 @@ class TestDeviceRECV(base.IntegrationTestCase): def test_device_recv_on(self): """Test if we can transition to on""" - d = DeviceProxy("LTS/RECV/1") + d = TestDeviceProxy("LTS/RECV/1") d.Initialise() diff --git a/tangostationcontrol/tangostationcontrol/integration_test/devices/test_device_sdp.py b/tangostationcontrol/tangostationcontrol/integration_test/devices/test_device_sdp.py index 333f4a830349cded5967c8440c76de091b75211a..faf965eb00c8c57785712b6bb581d9118c4632ba 100644 --- a/tangostationcontrol/tangostationcontrol/integration_test/devices/test_device_sdp.py +++ b/tangostationcontrol/tangostationcontrol/integration_test/devices/test_device_sdp.py @@ -10,6 +10,7 @@ from tango import DeviceProxy from tango._tango import DevState +from tangostationcontrol.integration_test.device_proxy import TestDeviceProxy from tangostationcontrol.integration_test import base @@ -21,7 +22,7 @@ class TestDeviceSDP(base.IntegrationTestCase): def tearDown(self): """Turn device Off in teardown to prevent blocking tests""" - d = DeviceProxy("LTS/SDP/1") + d = TestDeviceProxy("LTS/SDP/1") try: d.Off() @@ -32,21 +33,21 @@ class TestDeviceSDP(base.IntegrationTestCase): def test_device_proxy_sdp(self): """Test if we can successfully create a DeviceProxy and fetch state""" - d = DeviceProxy("LTS/SDP/1") + d = TestDeviceProxy("LTS/SDP/1") self.assertEqual(DevState.OFF, d.state()) def test_device_sdp_ping(self): """Test if we can successfully ping the device server""" - d = DeviceProxy("LTS/SDP/1") + d = TestDeviceProxy("LTS/SDP/1") self.assertGreater(d.ping(), 0) def test_device_sdp_initialize(self): """Test if we can transition to standby""" - d = DeviceProxy("LTS/SDP/1") + d = TestDeviceProxy("LTS/SDP/1") d.Initialise() @@ -55,7 +56,7 @@ class TestDeviceSDP(base.IntegrationTestCase): def test_device_sdp_on(self): """Test if we can transition to on""" - d = DeviceProxy("LTS/SDP/1") + d = TestDeviceProxy("LTS/SDP/1") d.Initialise() @@ -66,7 +67,7 @@ class TestDeviceSDP(base.IntegrationTestCase): def test_device_sdp_read_attribute(self): """Test if we can read an attribute obtained over OPC-UA""" - d = DeviceProxy("LTS/SDP/1") + d = TestDeviceProxy("LTS/SDP/1") d.initialise() diff --git a/tangostationcontrol/tangostationcontrol/integration_test/devices/test_device_sst.py b/tangostationcontrol/tangostationcontrol/integration_test/devices/test_device_sst.py index 7c20dc1cc96b5c87c6a1f2dc6e3cc5ef10fd2c13..513d5f7eaf5f5184db3960bff2eb4b8e300f0c74 100644 --- a/tangostationcontrol/tangostationcontrol/integration_test/devices/test_device_sst.py +++ b/tangostationcontrol/tangostationcontrol/integration_test/devices/test_device_sst.py @@ -10,9 +10,9 @@ import socket import sys import time -from tango import DeviceProxy from tango._tango import DevState +from tangostationcontrol.integration_test.device_proxy import base, TestDeviceProxy from tangostationcontrol.integration_test import base @@ -24,7 +24,7 @@ class TestDeviceSST(base.IntegrationTestCase): def tearDown(self): """Turn device Off in teardown to prevent blocking tests""" - d = DeviceProxy("LTS/SST/1") + d = TestDeviceProxy("LTS/SST/1") try: d.Off() @@ -35,14 +35,14 @@ class TestDeviceSST(base.IntegrationTestCase): def test_device_proxy_sst(self): """Test if we can successfully create a DeviceProxy and fetch state""" - d = DeviceProxy("LTS/SST/1") + d = TestDeviceProxy("LTS/SST/1") self.assertEqual(DevState.OFF, d.state()) def test_device_sst_initialize(self): """Test if we can transition to standby""" - d = DeviceProxy("LTS/SST/1") + d = TestDeviceProxy("LTS/SST/1") d.initialise() @@ -53,7 +53,7 @@ class TestDeviceSST(base.IntegrationTestCase): port_property = {"Statistics_Client_TCP_Port": "4999"} - d = DeviceProxy("LTS/SST/1") + d = TestDeviceProxy("LTS/SST/1") self.assertEqual(DevState.OFF, d.state(), "Prerequisite could not be met " @@ -72,7 +72,7 @@ class TestDeviceSST(base.IntegrationTestCase): def test_device_sst_send_udp(self): port_property = {"Statistics_Client_TCP_Port": "4998"} - d = DeviceProxy("LTS/SST/1") + d = TestDeviceProxy("LTS/SST/1") self.assertEqual(DevState.OFF, d.state(), "Prerequisite could not be met " @@ -101,7 +101,7 @@ class TestDeviceSST(base.IntegrationTestCase): m_data = "Hello World!".encode("UTF-8") - d = DeviceProxy("LTS/SST/1") + d = TestDeviceProxy("LTS/SST/1") self.assertEqual(DevState.OFF, d.state(), "Prerequisite could not be met " diff --git a/tangostationcontrol/tangostationcontrol/integration_test/devices/test_device_unb2.py b/tangostationcontrol/tangostationcontrol/integration_test/devices/test_device_unb2.py index a262aab7daa17a74253de7c8fb82d668496ded69..c699e225c05861f61786f332a70ccb3191f2dc5f 100644 --- a/tangostationcontrol/tangostationcontrol/integration_test/devices/test_device_unb2.py +++ b/tangostationcontrol/tangostationcontrol/integration_test/devices/test_device_unb2.py @@ -7,9 +7,9 @@ # Distributed under the terms of the APACHE license. # See LICENSE.txt for more info. -from tango import DeviceProxy from tango._tango import DevState +from tangostationcontrol.integration_test.device_proxy import TestDeviceProxy from tangostationcontrol.integration_test import base @@ -21,7 +21,7 @@ class TestDeviceUNB2(base.IntegrationTestCase): def tearDown(self): """Turn device Off in teardown to prevent blocking tests""" - d = DeviceProxy("LTS/UNB2/1") + d = TestDeviceProxy("LTS/UNB2/1") try: d.Off() @@ -32,14 +32,14 @@ class TestDeviceUNB2(base.IntegrationTestCase): def test_device_proxy_unb2(self): """Test if we can successfully create a DeviceProxy and fetch state""" - d = DeviceProxy("LTS/UNB2/1") + d = TestDeviceProxy("LTS/UNB2/1") self.assertEqual(DevState.OFF, d.state()) def test_device_unb2_initialize(self): """Test if we can transition to standby""" - d = DeviceProxy("LTS/UNB2/1") + d = TestDeviceProxy("LTS/UNB2/1") d.initialise() @@ -48,7 +48,7 @@ class TestDeviceUNB2(base.IntegrationTestCase): def test_device_unb2_on(self): """Test if we can transition to on""" - d = DeviceProxy("LTS/UNB2/1") + d = TestDeviceProxy("LTS/UNB2/1") d.initialise()