Skip to content
Snippets Groups Projects
Commit 2fe29e7d authored by Mattia Mancini's avatar Mattia Mancini
Browse files

OSB-37: fixing broken tests

parent eab028c1
No related branches found
No related tags found
2 merge requests!89Monitoring maintenance Epic branch merge,!1Resolve OSB-13 "Monitoringmaintenance "
...@@ -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):
......
...@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment