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
2fe29e7d
Commit
2fe29e7d
authored
6 years ago
by
Mattia Mancini
Browse files
Options
Downloads
Patches
Plain Diff
OSB-37
: fixing broken tests
parent
eab028c1
No related branches found
No related tags found
2 merge requests
!89
Monitoring maintenance Epic branch merge
,
!1
Resolve OSB-13 "Monitoringmaintenance "
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
LCU/Maintenance/MDB_tools/test/t_client.py
+6
-6
6 additions, 6 deletions
LCU/Maintenance/MDB_tools/test/t_client.py
LCU/Maintenance/MDB_tools/test/t_station_tests_watchdog.py
+1
-1
1 addition, 1 deletion
LCU/Maintenance/MDB_tools/test/t_station_tests_watchdog.py
with
7 additions
and
7 deletions
LCU/Maintenance/MDB_tools/test/t_client.py
+
6
−
6
View file @
2fe29e7d
...
@@ -48,9 +48,9 @@ class TESTMDBClient(unittest.TestCase):
...
@@ -48,9 +48,9 @@ class TESTMDBClient(unittest.TestCase):
mocked_post
.
return_value
=
response
mocked_post
.
return_value
=
response
full_address
=
'
/
'
.
join
([
address
,
compose_api_url_for_given_test_type
(
station_test_content
)])
full_address
=
'
/
'
.
join
([
address
,
compose_api_url_for_given_test_type
(
station_test_content
)])
result
=
send_stationtest_rtsm_content_to_address
(
'
http://testaddress
'
,
station_test_content
)
result
=
send_stationtest_rtsm_content_to_address
(
'
http://testaddress
'
,
dict
(
content
=
station_test_content
)
)
self
.
assertTrue
(
mocked_post
.
called
)
self
.
assertTrue
(
mocked_post
.
called
)
mocked_post
.
assert_called_with
(
full_address
,
data
=
station_test_content
)
mocked_post
.
assert_called_with
(
full_address
,
data
=
dict
(
content
=
station_test_content
)
)
self
.
assertTrue
(
result
)
self
.
assertTrue
(
result
)
@patch
(
'
requests.post
'
)
@patch
(
'
requests.post
'
)
...
@@ -61,18 +61,18 @@ class TESTMDBClient(unittest.TestCase):
...
@@ -61,18 +61,18 @@ class TESTMDBClient(unittest.TestCase):
mocked_post
.
return_value
=
response
mocked_post
.
return_value
=
response
full_address
=
'
/
'
.
join
([
address
,
compose_api_url_for_given_test_type
(
station_test_content
)])
full_address
=
'
/
'
.
join
([
address
,
compose_api_url_for_given_test_type
(
station_test_content
)])
result
=
send_stationtest_rtsm_content_to_address
(
'
http://testaddress
'
,
station_test_content
)
result
=
send_stationtest_rtsm_content_to_address
(
'
http://testaddress
'
,
dict
(
content
=
station_test_content
)
)
self
.
assertTrue
(
mocked_post
.
called
)
self
.
assertTrue
(
mocked_post
.
called
)
mocked_post
.
assert_called_with
(
full_address
,
data
=
station_test_content
)
mocked_post
.
assert_called_with
(
full_address
,
data
=
dict
(
content
=
station_test_content
)
)
self
.
assertFalse
(
result
)
self
.
assertFalse
(
result
)
def
test_compose_api_url_for_given_test_type_is_rtsm
(
self
):
def
test_compose_api_url_for_given_test_type_is_rtsm
(
self
):
rtsm_test_content
=
load_rtsm_test
()
rtsm_test_content
=
load_rtsm_test
()
self
.
assertEqual
(
compose_api_url_for_given_test_type
(
rtsm_test_content
),
'
rtsm/insert
_raw
'
)
self
.
assertEqual
(
compose_api_url_for_given_test_type
(
rtsm_test_content
),
'
rtsm/
raw/
insert
'
)
def
test_compose_api_url_for_given_test_type_is_station_test
(
self
):
def
test_compose_api_url_for_given_test_type_is_station_test
(
self
):
station_test_content
=
load_station_test
()
station_test_content
=
load_station_test
()
self
.
assertEqual
(
compose_api_url_for_given_test_type
(
station_test_content
),
'
stationtests/insert
_raw
'
)
self
.
assertEqual
(
compose_api_url_for_given_test_type
(
station_test_content
),
'
stationtests/
raw/
insert
'
)
def
test_compose_api_url_for_given_test_type_raises_content_unrecognized
(
self
):
def
test_compose_api_url_for_given_test_type_raises_content_unrecognized
(
self
):
with
self
.
assertRaises
(
ValueError
):
with
self
.
assertRaises
(
ValueError
):
...
...
This diff is collapsed.
Click to expand it.
LCU/Maintenance/MDB_tools/test/t_station_tests_watchdog.py
+
1
−
1
View file @
2fe29e7d
...
@@ -191,7 +191,7 @@ class TestStationTestsWatchdog(unittest.TestCase):
...
@@ -191,7 +191,7 @@ class TestStationTestsWatchdog(unittest.TestCase):
mock_logging
,
mock_logging
,
partial_mock_sys
):
partial_mock_sys
):
mock_arguments
=
[
self
.
mock_path
,
self
.
mock_filename
,
'
--addr
'
,
self
.
mock_address
]
mock_arguments
=
[
self
.
mock_path
,
self
.
mock_filename
,
'
--addr
'
,
self
.
mock_address
]
partial_mock_sys
.
argv
=
mock_arguments
partial_mock_sys
.
argv
=
[
'
program_filename
'
]
+
mock_arguments
mock_observer
=
MagicMock
()
mock_observer
=
MagicMock
()
mock_instantiate_file_creation_event_observer
.
return_value
=
mock_observer
mock_instantiate_file_creation_event_observer
.
return_value
=
mock_observer
...
...
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