Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
LOFAR
Manage
Activity
Members
Labels
Plan
Issues
Wiki
Jira issues
Open Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review 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
RadioObservatory
LOFAR
Commits
42e5b0f9
Commit
42e5b0f9
authored
5 years ago
by
Jorrit Schaap
Browse files
Options
Downloads
Patches
Plain Diff
SW-815
: more checks for integer types.
parent
3a4d56a5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!59
Merge LOFAR-Release-4_0 into master
,
!55
Resolve SW-815
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
SAS/ResourceAssignment/TaskPrescheduler/test/test_taskprescheduler.py
+22
-0
22 additions, 0 deletions
...Assignment/TaskPrescheduler/test/test_taskprescheduler.py
with
22 additions
and
0 deletions
SAS/ResourceAssignment/TaskPrescheduler/test/test_taskprescheduler.py
+
22
−
0
View file @
42e5b0f9
...
@@ -208,7 +208,14 @@ class PreschedulerTest(unittest.TestCase):
...
@@ -208,7 +208,14 @@ class PreschedulerTest(unittest.TestCase):
def
test_CobaltOTDBsettings
(
self
):
def
test_CobaltOTDBsettings
(
self
):
otdb_info
=
cobaltOTDBsettings
(
self
.
test_cobalt_settings
)
otdb_info
=
cobaltOTDBsettings
(
self
.
test_cobalt_settings
)
# beware! assertEqual succeeds for a comparison between 42.0 and 42
# but for lofar specs it is essential that some values are int
# so, check specifically for those!
self
.
assertEqual
(
otdb_info
,
self
.
otdb_info
)
self
.
assertEqual
(
otdb_info
,
self
.
otdb_info
)
self
.
assertEqual
(
int
,
type
(
otdb_info
[
'
LOFAR.ObsSW.Observation.ObservationControl.OnlineControl.Cobalt.Correlator.nrBlocksPerIntegration
'
]))
self
.
assertEqual
(
int
,
type
(
otdb_info
[
'
LOFAR.ObsSW.Observation.ObservationControl.OnlineControl.Cobalt.Correlator.nrIntegrationsPerBlock
'
]))
self
.
assertEqual
(
int
,
type
(
otdb_info
[
'
LOFAR.ObsSW.Observation.ObservationControl.OnlineControl.Cobalt.blockSize
'
]))
@mock.patch
(
'
lofar.sas.resourceassignment.common.specification.logger
'
)
@mock.patch
(
'
lofar.sas.resourceassignment.common.specification.logger
'
)
def
test_onObservationApproved_log_mom_id_found
(
self
,
logger_mock
):
def
test_onObservationApproved_log_mom_id_found
(
self
,
logger_mock
):
...
@@ -301,6 +308,21 @@ class PreschedulerTest(unittest.TestCase):
...
@@ -301,6 +308,21 @@ class PreschedulerTest(unittest.TestCase):
self
.
assertEqual
(
int
,
type
(
cobalt_settings
[
'
nrBlocks
'
]))
self
.
assertEqual
(
int
,
type
(
cobalt_settings
[
'
nrBlocks
'
]))
self
.
assertEqual
(
int
,
type
(
cobalt_settings
[
'
nrSubBlocks
'
]))
self
.
assertEqual
(
int
,
type
(
cobalt_settings
[
'
nrSubBlocks
'
]))
def
test_calculateCobaltSettingsAndConvertToOTDBsettings
(
self
):
'''
combination of test_CobaltOTDBsettings and test_calculateCobaltSettings
Make sure that the values are calculated and converted correctly
'''
spec
=
Specification
(
self
.
otdbrpc_mock
,
self
.
momrpc_mock
,
self
.
radbrpc_mock
)
spec
.
internal_dict
=
self
.
test_specification
otdb_info
=
cobaltOTDBsettings
(
calculateCobaltSettings
(
spec
))
# beware! assertEqual succeeds for a comparison between 42.0 and 42
# but for lofar specs it is essential that some values are int
# so, check specifically for those!
self
.
assertEqual
(
otdb_info
,
self
.
otdb_info
)
self
.
assertEqual
(
int
,
type
(
otdb_info
[
'
LOFAR.ObsSW.Observation.ObservationControl.OnlineControl.Cobalt.Correlator.nrBlocksPerIntegration
'
]))
self
.
assertEqual
(
int
,
type
(
otdb_info
[
'
LOFAR.ObsSW.Observation.ObservationControl.OnlineControl.Cobalt.Correlator.nrIntegrationsPerBlock
'
]))
self
.
assertEqual
(
int
,
type
(
otdb_info
[
'
LOFAR.ObsSW.Observation.ObservationControl.OnlineControl.Cobalt.blockSize
'
]))
@mock.patch
(
"
lofar.common.util.waitForInterrupt
"
)
@mock.patch
(
"
lofar.common.util.waitForInterrupt
"
)
@mock.patch
(
"
lofar.messaging.messagebus.BusListener.start_listening
"
)
@mock.patch
(
"
lofar.messaging.messagebus.BusListener.start_listening
"
)
def
test_main
(
self
,
mock_wait
,
mock_otdbbuslistener
):
def
test_main
(
self
,
mock_wait
,
mock_otdbbuslistener
):
...
...
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