diff --git a/devices/integration_test/device_proxy.py b/devices/integration_test/device_proxy.py new file mode 100644 index 0000000000000000000000000000000000000000..00ba0904c7bd01fa2ce1453a4c6701d6a4246e14 --- /dev/null +++ b/devices/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/devices/integration_test/devices/test_device_recv.py b/devices/integration_test/devices/test_device_recv.py index d7ba9e2a00884d36d45bd6036e426d832af23617..72199e292d9a8ce5ab90c69d764d03a342bb41c9 100644 --- a/devices/integration_test/devices/test_device_recv.py +++ b/devices/integration_test/devices/test_device_recv.py @@ -7,11 +7,9 @@ # 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 +from integration_test.device_proxy import TestDeviceProxy from integration_test import base @@ -22,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() @@ -33,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() @@ -49,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/devices/integration_test/devices/test_device_sdp.py b/devices/integration_test/devices/test_device_sdp.py index eef62dc907b91b826ab9768c293c2b7f4ef26508..3db8b744ffc6679cfd9389640a9d27e18c3d2ca1 100644 --- a/devices/integration_test/devices/test_device_sdp.py +++ b/devices/integration_test/devices/test_device_sdp.py @@ -7,11 +7,9 @@ # 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 +from integration_test.device_proxy import TestDeviceProxy from integration_test import base @@ -23,7 +21,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() @@ -34,21 +32,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() @@ -57,7 +55,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() @@ -68,7 +66,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/devices/integration_test/devices/test_device_sst.py b/devices/integration_test/devices/test_device_sst.py index a6b71d328305f2dafed46f9e4f3ea9209df9601d..759028324d5c63dea55a930c2bd0557d69f7213d 100644 --- a/devices/integration_test/devices/test_device_sst.py +++ b/devices/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 integration_test.device_proxy import TestDeviceProxy from 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/devices/integration_test/devices/test_device_unb2.py b/devices/integration_test/devices/test_device_unb2.py index d796e586cd5165b0e3fb7cd09c1c3acf5cdd747c..00702a36a1b480ad583d29d80da69874cc1e98af 100644 --- a/devices/integration_test/devices/test_device_unb2.py +++ b/devices/integration_test/devices/test_device_unb2.py @@ -7,11 +7,9 @@ # 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 +from integration_test.device_proxy import TestDeviceProxy from integration_test import base @@ -23,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() @@ -34,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() @@ -50,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()