Skip to content
Snippets Groups Projects
Commit a838436a authored by Jan David Mol's avatar Jan David Mol
Browse files

Merge branch 'master' into L2SS-287-python-packaging

parents 392f7ef5 0b29e3be
Branches
Tags
1 merge request!146L2SS-287: implement python packaging
from tango import DeviceProxy
class TestDeviceProxy(DeviceProxy):
def __init__(self, *args, **kwargs):
super(TestDeviceProxy, self).__init__(*args, **kwargs)
self.set_timeout_millis(10000)
...@@ -7,9 +7,9 @@ ...@@ -7,9 +7,9 @@
# Distributed under the terms of the APACHE license. # Distributed under the terms of the APACHE license.
# See LICENSE.txt for more info. # See LICENSE.txt for more info.
from tango import DeviceProxy
from tango._tango import DevState from tango._tango import DevState
from tangostationcontrol.integration_test.device_proxy import TestDeviceProxy
from tangostationcontrol.integration_test import base from tangostationcontrol.integration_test import base
...@@ -20,7 +20,7 @@ class TestDeviceRECV(base.IntegrationTestCase): ...@@ -20,7 +20,7 @@ class TestDeviceRECV(base.IntegrationTestCase):
def tearDown(self): def tearDown(self):
"""Turn device Off in teardown to prevent blocking tests""" """Turn device Off in teardown to prevent blocking tests"""
d = DeviceProxy("LTS/RECV/1") d = TestDeviceProxy("LTS/RECV/1")
try: try:
d.Off() d.Off()
...@@ -31,14 +31,14 @@ class TestDeviceRECV(base.IntegrationTestCase): ...@@ -31,14 +31,14 @@ class TestDeviceRECV(base.IntegrationTestCase):
def test_device_proxy_recv(self): def test_device_proxy_recv(self):
"""Test if we can successfully create a DeviceProxy and fetch state""" """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()) self.assertEqual(DevState.OFF, d.state())
def test_device_recv_initialize(self): def test_device_recv_initialize(self):
"""Test if we can transition to standby""" """Test if we can transition to standby"""
d = DeviceProxy("LTS/RECV/1") d = TestDeviceProxy("LTS/RECV/1")
d.Initialise() d.Initialise()
...@@ -47,7 +47,7 @@ class TestDeviceRECV(base.IntegrationTestCase): ...@@ -47,7 +47,7 @@ class TestDeviceRECV(base.IntegrationTestCase):
def test_device_recv_on(self): def test_device_recv_on(self):
"""Test if we can transition to on""" """Test if we can transition to on"""
d = DeviceProxy("LTS/RECV/1") d = TestDeviceProxy("LTS/RECV/1")
d.Initialise() d.Initialise()
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
from tango import DeviceProxy from tango import DeviceProxy
from tango._tango import DevState from tango._tango import DevState
from tangostationcontrol.integration_test.device_proxy import TestDeviceProxy
from tangostationcontrol.integration_test import base from tangostationcontrol.integration_test import base
...@@ -21,7 +22,7 @@ class TestDeviceSDP(base.IntegrationTestCase): ...@@ -21,7 +22,7 @@ class TestDeviceSDP(base.IntegrationTestCase):
def tearDown(self): def tearDown(self):
"""Turn device Off in teardown to prevent blocking tests""" """Turn device Off in teardown to prevent blocking tests"""
d = DeviceProxy("LTS/SDP/1") d = TestDeviceProxy("LTS/SDP/1")
try: try:
d.Off() d.Off()
...@@ -32,21 +33,21 @@ class TestDeviceSDP(base.IntegrationTestCase): ...@@ -32,21 +33,21 @@ class TestDeviceSDP(base.IntegrationTestCase):
def test_device_proxy_sdp(self): def test_device_proxy_sdp(self):
"""Test if we can successfully create a DeviceProxy and fetch state""" """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()) self.assertEqual(DevState.OFF, d.state())
def test_device_sdp_ping(self): def test_device_sdp_ping(self):
"""Test if we can successfully ping the device server""" """Test if we can successfully ping the device server"""
d = DeviceProxy("LTS/SDP/1") d = TestDeviceProxy("LTS/SDP/1")
self.assertGreater(d.ping(), 0) self.assertGreater(d.ping(), 0)
def test_device_sdp_initialize(self): def test_device_sdp_initialize(self):
"""Test if we can transition to standby""" """Test if we can transition to standby"""
d = DeviceProxy("LTS/SDP/1") d = TestDeviceProxy("LTS/SDP/1")
d.Initialise() d.Initialise()
...@@ -55,7 +56,7 @@ class TestDeviceSDP(base.IntegrationTestCase): ...@@ -55,7 +56,7 @@ class TestDeviceSDP(base.IntegrationTestCase):
def test_device_sdp_on(self): def test_device_sdp_on(self):
"""Test if we can transition to on""" """Test if we can transition to on"""
d = DeviceProxy("LTS/SDP/1") d = TestDeviceProxy("LTS/SDP/1")
d.Initialise() d.Initialise()
...@@ -66,7 +67,7 @@ class TestDeviceSDP(base.IntegrationTestCase): ...@@ -66,7 +67,7 @@ class TestDeviceSDP(base.IntegrationTestCase):
def test_device_sdp_read_attribute(self): def test_device_sdp_read_attribute(self):
"""Test if we can read an attribute obtained over OPC-UA""" """Test if we can read an attribute obtained over OPC-UA"""
d = DeviceProxy("LTS/SDP/1") d = TestDeviceProxy("LTS/SDP/1")
d.initialise() d.initialise()
......
...@@ -10,9 +10,9 @@ import socket ...@@ -10,9 +10,9 @@ import socket
import sys import sys
import time import time
from tango import DeviceProxy
from tango._tango import DevState from tango._tango import DevState
from tangostationcontrol.integration_test.device_proxy import base, TestDeviceProxy
from tangostationcontrol.integration_test import base from tangostationcontrol.integration_test import base
...@@ -24,7 +24,7 @@ class TestDeviceSST(base.IntegrationTestCase): ...@@ -24,7 +24,7 @@ class TestDeviceSST(base.IntegrationTestCase):
def tearDown(self): def tearDown(self):
"""Turn device Off in teardown to prevent blocking tests""" """Turn device Off in teardown to prevent blocking tests"""
d = DeviceProxy("LTS/SST/1") d = TestDeviceProxy("LTS/SST/1")
try: try:
d.Off() d.Off()
...@@ -35,14 +35,14 @@ class TestDeviceSST(base.IntegrationTestCase): ...@@ -35,14 +35,14 @@ class TestDeviceSST(base.IntegrationTestCase):
def test_device_proxy_sst(self): def test_device_proxy_sst(self):
"""Test if we can successfully create a DeviceProxy and fetch state""" """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()) self.assertEqual(DevState.OFF, d.state())
def test_device_sst_initialize(self): def test_device_sst_initialize(self):
"""Test if we can transition to standby""" """Test if we can transition to standby"""
d = DeviceProxy("LTS/SST/1") d = TestDeviceProxy("LTS/SST/1")
d.initialise() d.initialise()
...@@ -53,7 +53,7 @@ class TestDeviceSST(base.IntegrationTestCase): ...@@ -53,7 +53,7 @@ class TestDeviceSST(base.IntegrationTestCase):
port_property = {"Statistics_Client_TCP_Port": "4999"} port_property = {"Statistics_Client_TCP_Port": "4999"}
d = DeviceProxy("LTS/SST/1") d = TestDeviceProxy("LTS/SST/1")
self.assertEqual(DevState.OFF, d.state(), self.assertEqual(DevState.OFF, d.state(),
"Prerequisite could not be met " "Prerequisite could not be met "
...@@ -72,7 +72,7 @@ class TestDeviceSST(base.IntegrationTestCase): ...@@ -72,7 +72,7 @@ class TestDeviceSST(base.IntegrationTestCase):
def test_device_sst_send_udp(self): def test_device_sst_send_udp(self):
port_property = {"Statistics_Client_TCP_Port": "4998"} port_property = {"Statistics_Client_TCP_Port": "4998"}
d = DeviceProxy("LTS/SST/1") d = TestDeviceProxy("LTS/SST/1")
self.assertEqual(DevState.OFF, d.state(), self.assertEqual(DevState.OFF, d.state(),
"Prerequisite could not be met " "Prerequisite could not be met "
...@@ -101,7 +101,7 @@ class TestDeviceSST(base.IntegrationTestCase): ...@@ -101,7 +101,7 @@ class TestDeviceSST(base.IntegrationTestCase):
m_data = "Hello World!".encode("UTF-8") m_data = "Hello World!".encode("UTF-8")
d = DeviceProxy("LTS/SST/1") d = TestDeviceProxy("LTS/SST/1")
self.assertEqual(DevState.OFF, d.state(), self.assertEqual(DevState.OFF, d.state(),
"Prerequisite could not be met " "Prerequisite could not be met "
......
...@@ -7,9 +7,9 @@ ...@@ -7,9 +7,9 @@
# Distributed under the terms of the APACHE license. # Distributed under the terms of the APACHE license.
# See LICENSE.txt for more info. # See LICENSE.txt for more info.
from tango import DeviceProxy
from tango._tango import DevState from tango._tango import DevState
from tangostationcontrol.integration_test.device_proxy import TestDeviceProxy
from tangostationcontrol.integration_test import base from tangostationcontrol.integration_test import base
...@@ -21,7 +21,7 @@ class TestDeviceUNB2(base.IntegrationTestCase): ...@@ -21,7 +21,7 @@ class TestDeviceUNB2(base.IntegrationTestCase):
def tearDown(self): def tearDown(self):
"""Turn device Off in teardown to prevent blocking tests""" """Turn device Off in teardown to prevent blocking tests"""
d = DeviceProxy("LTS/UNB2/1") d = TestDeviceProxy("LTS/UNB2/1")
try: try:
d.Off() d.Off()
...@@ -32,14 +32,14 @@ class TestDeviceUNB2(base.IntegrationTestCase): ...@@ -32,14 +32,14 @@ class TestDeviceUNB2(base.IntegrationTestCase):
def test_device_proxy_unb2(self): def test_device_proxy_unb2(self):
"""Test if we can successfully create a DeviceProxy and fetch state""" """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()) self.assertEqual(DevState.OFF, d.state())
def test_device_unb2_initialize(self): def test_device_unb2_initialize(self):
"""Test if we can transition to standby""" """Test if we can transition to standby"""
d = DeviceProxy("LTS/UNB2/1") d = TestDeviceProxy("LTS/UNB2/1")
d.initialise() d.initialise()
...@@ -48,7 +48,7 @@ class TestDeviceUNB2(base.IntegrationTestCase): ...@@ -48,7 +48,7 @@ class TestDeviceUNB2(base.IntegrationTestCase):
def test_device_unb2_on(self): def test_device_unb2_on(self):
"""Test if we can transition to on""" """Test if we can transition to on"""
d = DeviceProxy("LTS/UNB2/1") d = TestDeviceProxy("LTS/UNB2/1")
d.initialise() d.initialise()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment