Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tango
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira issues
Open Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LOFAR2.0
tango
Commits
1d707647
Commit
1d707647
authored
3 years ago
by
Corné Lukken
Browse files
Options
Downloads
Patches
Plain Diff
L2SS-240
: Test if we can enable SDP and APSCT devices
parent
23c5d564
No related branches found
No related tags found
1 merge request
!89
Resolve L2SS-240 "Integration testing"
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
devices/integration_test/devices/test_device_apsct.py
+36
-0
36 additions, 0 deletions
devices/integration_test/devices/test_device_apsct.py
devices/integration_test/devices/test_device_sdp.py
+35
-0
35 additions, 0 deletions
devices/integration_test/devices/test_device_sdp.py
with
71 additions
and
0 deletions
devices/integration_test/devices/test_device_apsct.py
+
36
−
0
View file @
1d707647
...
...
@@ -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
())
This diff is collapsed.
Click to expand it.
devices/integration_test/devices/test_device_sdp.py
+
35
−
0
View file @
1d707647
...
...
@@ -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
())
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment