Skip to content
GitLab
Explore
Sign in
Register
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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LOFAR2.0
tango
Commits
bfece07e
Commit
bfece07e
authored
2 years ago
by
Stefano Di Frischia
Browse files
Options
Downloads
Patches
Plain Diff
L2SS-871
: add header info integration test
parent
6e81fe91
No related branches found
No related tags found
1 merge request
!407
Resolve L2SS-871 "update-hdf5-writer"
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
tangostationcontrol/tangostationcontrol/integration_test/default/statistics/test_writer_sst.py
+39
-0
39 additions, 0 deletions
...ol/integration_test/default/statistics/test_writer_sst.py
with
39 additions
and
0 deletions
tangostationcontrol/tangostationcontrol/integration_test/default/statistics/test_writer_sst.py
+
39
−
0
View file @
bfece07e
...
@@ -46,6 +46,45 @@ class TestStatisticsWriterSST(BaseIntegrationTestCase):
...
@@ -46,6 +46,45 @@ class TestStatisticsWriterSST(BaseIntegrationTestCase):
self
.
assertIsNotNone
(
self
.
recv_proxy
.
RCU_Band_Select_R
)
self
.
assertIsNotNone
(
self
.
recv_proxy
.
RCU_Band_Select_R
)
self
.
assertIsNotNone
(
self
.
recv_proxy
.
RCU_DTH_on_R
)
self
.
assertIsNotNone
(
self
.
recv_proxy
.
RCU_DTH_on_R
)
def
test_header_info
(
self
):
"""
Test whether the header info are inserted and collected in the proper way
"""
with
TemporaryDirectory
()
as
tmpdir
:
new_sys_argv
=
[
sys
.
argv
[
0
],
"
--mode
"
,
"
SST
"
,
"
--no-tango
"
,
"
--file
"
,
join
(
dirname
(
dirname
(
dirname
(
dirname
(
__file__
)))),
"
test/statistics
"
,
"
SDP_SST_statistics_packets.bin
"
),
"
--output_dir
"
,
tmpdir
]
with
mock
.
patch
.
object
(
entry
.
sys
,
'
argv
'
,
new_sys_argv
):
with
self
.
assertRaises
(
SystemExit
):
entry
.
main
()
# check if file was written
self
.
assertTrue
(
isfile
(
f
"
{
tmpdir
}
/SST_2021-09-20-12-17-40.h5
"
))
# test statistics reader
new_sys_argv
=
[
sys
.
argv
[
0
],
"
--files
"
,
f
"
{
tmpdir
}
/SST_2021-09-20-12-17-40.h5
"
,
"
--start_time
"
,
"
2021-09-20#07:40:08.937+00:00
"
,
"
--end_time
"
,
"
2021-10-04#07:50:08.937+00:00
"
]
with
mock
.
patch
.
object
(
reader
.
sys
,
'
argv
'
,
new_sys_argv
):
stat_parser
=
reader
.
setup_stat_parser
()
SSTstatistics
=
stat_parser
.
list_statistics
()
self
.
assertIsNotNone
(
SSTstatistics
)
stat
=
stat_parser
.
get_statistic
(
'
2021-09-20T12:17:40.000+00:00
'
)
self
.
assertIsNotNone
(
stat
)
self
.
assertEqual
(
"
0.1
"
,
stat
.
station_version_id
)
self
.
assertEqual
(
"
0.1
"
,
stat
.
writer_version_id
)
def
test_insert_tango_SST_statistics
(
self
):
def
test_insert_tango_SST_statistics
(
self
):
self
.
assertEqual
(
DevState
.
ON
,
self
.
recv_proxy
.
state
())
self
.
assertEqual
(
DevState
.
ON
,
self
.
recv_proxy
.
state
())
collector
=
StationSSTCollector
(
device
=
self
.
recv_proxy
)
collector
=
StationSSTCollector
(
device
=
self
.
recv_proxy
)
...
...
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