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
772b4055
Commit
772b4055
authored
5 years ago
by
Roy de Goei
Browse files
Options
Downloads
Patches
Plain Diff
TMSS-171
: Update SpecifyObservation testcase
parent
d6ee8570
No related branches found
No related tags found
1 merge request
!154
Resolve TMSS-60 and TMSS-171 and TMSS-198
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
SAS/TMSS/test/t_specify_observation.py
+15
-5
15 additions, 5 deletions
SAS/TMSS/test/t_specify_observation.py
with
15 additions
and
5 deletions
SAS/TMSS/test/t_specify_observation.py
+
15
−
5
View file @
772b4055
...
@@ -39,17 +39,27 @@ from lofar.sas.tmss.test.tmss_test_data_rest import TMSSRESTTestDataCreator
...
@@ -39,17 +39,27 @@ from lofar.sas.tmss.test.tmss_test_data_rest import TMSSRESTTestDataCreator
rest_data_creator
=
TMSSRESTTestDataCreator
(
BASE_URL
,
AUTH
)
rest_data_creator
=
TMSSRESTTestDataCreator
(
BASE_URL
,
AUTH
)
from
lofar.sas.tmss.tmss.tmssapp
import
models
from
lofar.sas.tmss.tmss.tmssapp
import
models
from
lofar.sas.tmss.tmss.tmssapp.tasks
import
run_specify_observation
from
lofar.sas.tmss.tmss.tmssapp.tasks
import
create_task_blueprint_from_task_draft_and_instantiate_subtasks_from_template
class
SpecifyObservationFromTaskDraftTest
(
unittest
.
TestCase
):
class
SpecifyObservationFromTaskDraftTest
(
unittest
.
TestCase
):
def
test_
01
(
self
):
def
test_
create_task_blueprint
(
self
):
"""
"""
Use the
'
default
'
task draft (ID=1) to specify observation and check if all subtasks are created
Use the
'
default
'
task draft (ID=1) to specify observation
Check if the task draft name is equal to the task draft name specified in the created task blueprint
Check with REST-call if 4 subtasks are created and if these subtaskshave state value
'
defined
'
"""
"""
task_draft
=
models
.
TaskDraft
.
objects
.
get
(
id
=
1
)
task_draft
=
models
.
TaskDraft
.
objects
.
get
(
id
=
1
)
run_specify_observation
(
task_draft
)
res_task_draft
=
GET_and_assert_equal_expected_code
(
self
,
BASE_URL
+
'
/task_draft/1/
'
,
200
)
# TODO check the objects created
task_blueprint
=
create_task_blueprint_from_task_draft_and_instantiate_subtasks_from_template
(
task_draft
)
self
.
assertEqual
(
task_draft
.
name
,
task_blueprint
.
draft
.
name
)
res_task_blueprint
=
GET_and_assert_equal_expected_code
(
self
,
BASE_URL
+
'
/task_blueprint/1/
'
,
200
)
self
.
assertEqual
(
len
(
res_task_blueprint
[
'
subtasks
'
]),
4
)
self
.
assertEqual
(
res_task_blueprint
[
'
specifications_template
'
],
res_task_draft
[
'
specifications_template
'
])
for
subtask_url
in
res_task_blueprint
[
'
subtasks
'
]:
res_subtask
=
GET_and_assert_equal_expected_code
(
self
,
subtask_url
,
200
)
state_value
=
GET_and_assert_equal_expected_code
(
self
,
res_subtask
[
'
state
'
],
200
)[
'
value
'
]
self
.
assertEqual
(
state_value
,
"
defined
"
)
if
__name__
==
"
__main__
"
:
if
__name__
==
"
__main__
"
:
...
...
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