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
7a16fc8f
Commit
7a16fc8f
authored
6 years ago
by
Jörn Künsemöller
Browse files
Options
Downloads
Patches
Plain Diff
Task
LSMR-14
: Fixed functional tests
parent
0fe58953
No related branches found
No related tags found
1 merge request
!87
Lsmr epic
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
SAS/LSMR/test/t_functional.py
+24
-31
24 additions, 31 deletions
SAS/LSMR/test/t_functional.py
SAS/LSMR/test/t_functional.run
+1
-1
1 addition, 1 deletion
SAS/LSMR/test/t_functional.run
with
25 additions
and
32 deletions
SAS/LSMR/test/t_functional.py
+
24
−
31
View file @
7a16fc8f
...
@@ -411,26 +411,30 @@ class WorkRelationSelectionTemplateTestCase(unittest.TestCase):
...
@@ -411,26 +411,30 @@ class WorkRelationSelectionTemplateTestCase(unittest.TestCase):
class
WorkIORoleTestCase
(
unittest
.
TestCase
):
class
WorkIORoleTestCase
(
unittest
.
TestCase
):
# test data
def
setUp
(
self
):
test_data_1
=
{
"
role
"
:
BASE_URL
+
'
/role_choice/correlator/
'
,
"
datatype
"
:
BASE_URL
+
'
/datatype_choice/image/
'
,
# related items
"
dataformat
"
:
BASE_URL
+
'
/dataformat_choice/HDF5/
'
,
url
=
POST_and_assert_expected_response
(
self
,
BASE_URL
+
'
/work_request_template/
'
,
"
outputs
"
:
None
,
WorkRequestTemplateTestCase
.
test_data_1
,
201
,
"
inputs
"
:
None
,
WorkRequestTemplateTestCase
.
test_data_1
)[
'
url
'
]
"
tags
"
:
[]
}
# test data
self
.
test_data_1
=
{
"
role
"
:
BASE_URL
+
'
/role_choice/correlator/
'
,
test_data_2
=
{
"
role
"
:
BASE_URL
+
'
/role_choice/target/
'
,
"
datatype
"
:
BASE_URL
+
'
/datatype_choice/image/
'
,
"
datatype
"
:
BASE_URL
+
'
/datatype_choice/visibilities/
'
,
"
dataformat
"
:
BASE_URL
+
'
/dataformat_choice/HDF5/
'
,
"
dataformat
"
:
BASE_URL
+
'
/dataformat_choice/MeasurementSet/
'
,
"
outputs
"
:
url
,
"
outputs
"
:
None
,
"
inputs
"
:
url
,
"
inputs
"
:
None
,
"
tags
"
:
[]}
"
tags
"
:
[]
}
self
.
test_data_2
=
{
"
role
"
:
BASE_URL
+
'
/role_choice/target/
'
,
"
datatype
"
:
BASE_URL
+
'
/datatype_choice/visibilities/
'
,
test_patch
=
{
"
role
"
:
BASE_URL
+
'
/role_choice/calibrator/
'
,
"
dataformat
"
:
BASE_URL
+
'
/dataformat_choice/MeasurementSet/
'
,
"
dataformat
"
:
BASE_URL
+
'
/dataformat_choice/MeasurementSet/
'
"
outputs
"
:
url
,
}
"
inputs
"
:
url
,
"
tags
"
:
[]}
self
.
test_patch
=
{
"
role
"
:
BASE_URL
+
'
/role_choice/calibrator/
'
,
"
dataformat
"
:
BASE_URL
+
'
/dataformat_choice/MeasurementSet/
'
}
def
test_work_io_role_list_apiformat
(
self
):
def
test_work_io_role_list_apiformat
(
self
):
r
=
requests
.
get
(
BASE_URL
+
'
/work_io_role/?format=api
'
)
r
=
requests
.
get
(
BASE_URL
+
'
/work_io_role/?format=api
'
)
...
@@ -478,17 +482,6 @@ class WorkIORoleTestCase(unittest.TestCase):
...
@@ -478,17 +482,6 @@ class WorkIORoleTestCase(unittest.TestCase):
r_dict
=
POST_and_assert_expected_response
(
self
,
BASE_URL
+
'
/work_io_role/
'
,
test_data_invalid
,
400
,
{})
r_dict
=
POST_and_assert_expected_response
(
self
,
BASE_URL
+
'
/work_io_role/
'
,
test_data_invalid
,
400
,
{})
self
.
assertTrue
(
'
Invalid hyperlink
'
in
str
(
r_dict
[
'
inputs
'
]))
self
.
assertTrue
(
'
Invalid hyperlink
'
in
str
(
r_dict
[
'
inputs
'
]))
def
test_work_io_role_POST_existing_inputs_works
(
self
):
# First POST a new item to reference
r_dict
=
POST_and_assert_expected_response
(
self
,
BASE_URL
+
'
/work_request_template/
'
,
WorkRequestTemplateTestCase
.
test_data_1
,
201
,
WorkRequestTemplateTestCase
.
test_data_1
,)
url
=
r_dict
[
'
url
'
]
# POST a new item with correct reference
test_data_valid
=
dict
(
self
.
test_data_1
)
test_data_valid
[
'
inputs
'
]
=
url
POST_and_assert_expected_response
(
self
,
BASE_URL
+
'
/work_io_role/
'
,
test_data_valid
,
201
,
test_data_valid
)
def
test_work_io_role_POST_nonexistant_outputs_raises_error
(
self
):
def
test_work_io_role_POST_nonexistant_outputs_raises_error
(
self
):
# POST a new item with wrong reference
# POST a new item with wrong reference
...
...
This diff is collapsed.
Click to expand it.
SAS/LSMR/test/t_functional.run
+
1
−
1
View file @
7a16fc8f
...
@@ -10,7 +10,7 @@ PORT=8777
...
@@ -10,7 +10,7 @@ PORT=8777
lsmr
-p
$PORT
&
lsmr
-p
$PORT
&
DJANGO_PID
=
$!
DJANGO_PID
=
$!
echo
"Started Django server with PID: "
$DJANGO_PID
echo
"Started Django server with PID: "
$DJANGO_PID
sleep
3
sleep
15
# Run test
# Run test
./t_functional.py
./t_functional.py
...
...
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