Skip to content
GitLab
Explore
Sign in
Register
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
20a6867d
Commit
20a6867d
authored
3 years ago
by
Mario Raciti
Browse files
Options
Downloads
Patches
Plain Diff
TMSS-655
: Fix _create_target_observation_subtask default parameter
parent
39823872
Branches
Branches containing commit
Tags
Tags containing commit
4 merge requests
!634
WIP: COBALT commissioning delta
,
!512
From master into TMSS-849-Commissioning-sprint-9
,
!509
Resolve TMSS-655
,
!481
Draft: SW-971 SW-973 SW-975: Various fixes to build LOFAR correctly.
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
SAS/TMSS/backend/test/t_scheduling.py
+6
-6
6 additions, 6 deletions
SAS/TMSS/backend/test/t_scheduling.py
with
6 additions
and
6 deletions
SAS/TMSS/backend/test/t_scheduling.py
+
6
−
6
View file @
20a6867d
...
@@ -145,14 +145,14 @@ class SchedulingTest(unittest.TestCase):
...
@@ -145,14 +145,14 @@ class SchedulingTest(unittest.TestCase):
def
_create_target_observation_subtask
(
specification_doc
:
dict
=
None
)
->
dict
:
def
_create_target_observation_subtask
(
specification_doc
:
dict
=
None
)
->
dict
:
'''
create a target observation subtask in defined state and return the subtask as json dict.
'''
create a target observation subtask in defined state and return the subtask as json dict.
if the given specification_doc is None, then the defaults are used.
'''
if the given specification_doc is None, then the defaults are used.
'''
if
specification_doc
is
None
:
specification_doc
=
{
'
stations
'
:
{
'
digital_pointings
'
:
[{
'
name
'
:
'
target0
'
,
'
subbands
'
:
[
0
]}],
'
station_list
'
:
[
'
CS001
'
,
'
CS002
'
,
'
CS003
'
]}}
with
tmss_test_env
.
create_tmss_client
()
as
client
:
with
tmss_test_env
.
create_tmss_client
()
as
client
:
task_blueprint_data
=
test_data_creator
.
TaskBlueprint
(
template_url
=
client
.
get_task_template
(
name
=
"
target observation
"
)[
'
url
'
])
task_blueprint_data
=
test_data_creator
.
TaskBlueprint
(
template_url
=
client
.
get_task_template
(
name
=
"
target observation
"
)[
'
url
'
])
task_blueprint_data
[
'
specifications_doc
'
][
'
SAPs
'
][
0
][
'
name
'
]
=
specification_doc
[
'
stations
'
][
'
digital_pointings
'
][
0
][
'
name
'
]
task_blueprint_data
[
'
specifications_doc
'
][
'
SAPs
'
][
0
][
'
name
'
]
=
specification_doc
[
'
stations
'
][
'
digital_pointings
'
][
0
][
'
name
'
]
task_blueprint
=
test_data_creator
.
post_data_and_get_response_as_json_object
(
task_blueprint_data
,
'
/task_blueprint/
'
)
task_blueprint
=
test_data_creator
.
post_data_and_get_response_as_json_object
(
task_blueprint_data
,
'
/task_blueprint/
'
)
if
specification_doc
is
None
:
specification_doc
=
{}
subtask_template
=
client
.
get_subtask_template
(
"
observation control
"
)
subtask_template
=
client
.
get_subtask_template
(
"
observation control
"
)
specification_doc
=
add_defaults_to_json_object_for_schema
(
specification_doc
,
subtask_template
[
'
schema
'
])
specification_doc
=
add_defaults_to_json_object_for_schema
(
specification_doc
,
subtask_template
[
'
schema
'
])
cluster_url
=
client
.
get_path_as_json_object
(
'
/cluster/1
'
)[
'
url
'
]
cluster_url
=
client
.
get_path_as_json_object
(
'
/cluster/1
'
)[
'
url
'
]
...
@@ -311,7 +311,7 @@ class SchedulingTest(unittest.TestCase):
...
@@ -311,7 +311,7 @@ class SchedulingTest(unittest.TestCase):
def
test_schedule_observation_subtask_with_blocking_reservations_failed
(
self
):
def
test_schedule_observation_subtask_with_blocking_reservations_failed
(
self
):
"""
"""
Set (Resource Assigner) station CS001, CS002, CS401
, CS501
to reserved
Set (Resource Assigner) station CS001, CS002, CS401 to reserved
Schedule subtask with stations CS001, CS002, CS401
Schedule subtask with stations CS001, CS002, CS401
Check if schedule of the subtask fail
Check if schedule of the subtask fail
"""
"""
...
@@ -338,9 +338,9 @@ class SchedulingTest(unittest.TestCase):
...
@@ -338,9 +338,9 @@ class SchedulingTest(unittest.TestCase):
def
test_schedule_observation_subtask_with_blocking_reservation_ok
(
self
):
def
test_schedule_observation_subtask_with_blocking_reservation_ok
(
self
):
"""
"""
Set (Resource Assigner) station CS001 to reserved
Set (Resource Assigner) station CS001
, CS003
to reserved
Schedule subtask with station CS001, CS002, CS003
Schedule subtask with station CS001, CS002, CS003
Check if schedule of the subtasks do not fail (it can schedule with station CS002
and CS003
)
Check if schedule of the subtasks do not fail (it can schedule with station CS002)
"""
"""
self
.
assertTrue
(
create_reserved_stations_for_testing
([
'
CS001
'
,
'
CS003
'
]))
self
.
assertTrue
(
create_reserved_stations_for_testing
([
'
CS001
'
,
'
CS003
'
]))
...
...
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