Skip to content
Snippets Groups Projects
Commit 1d707647 authored by Corné Lukken's avatar Corné Lukken
Browse files

L2SS-240: Test if we can enable SDP and APSCT devices

parent 23c5d564
No related branches found
No related tags found
1 merge request!89Resolve L2SS-240 "Integration testing"
......@@ -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())
......@@ -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())
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment