From 2fe29e7dda38d2b6f7a596470e11c1c3d905f9d7 Mon Sep 17 00:00:00 2001
From: Mattia Mancini <mancini@astron.nl>
Date: Wed, 9 Jan 2019 16:03:50 +0000
Subject: [PATCH] OSB-37: fixing broken tests

---
 LCU/Maintenance/MDB_tools/test/t_client.py           | 12 ++++++------
 .../MDB_tools/test/t_station_tests_watchdog.py       |  2 +-
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/LCU/Maintenance/MDB_tools/test/t_client.py b/LCU/Maintenance/MDB_tools/test/t_client.py
index 8b5257c4879..f824c6599cd 100644
--- a/LCU/Maintenance/MDB_tools/test/t_client.py
+++ b/LCU/Maintenance/MDB_tools/test/t_client.py
@@ -48,9 +48,9 @@ class TESTMDBClient(unittest.TestCase):
         mocked_post.return_value = response
 
         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)
-        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)
 
     @patch('requests.post')
@@ -61,18 +61,18 @@ class TESTMDBClient(unittest.TestCase):
         mocked_post.return_value = response
 
         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)
-        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)
 
     def test_compose_api_url_for_given_test_type_is_rtsm(self):
         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):
         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):
         with self.assertRaises(ValueError):
diff --git a/LCU/Maintenance/MDB_tools/test/t_station_tests_watchdog.py b/LCU/Maintenance/MDB_tools/test/t_station_tests_watchdog.py
index 387be781937..37fb53efc83 100644
--- a/LCU/Maintenance/MDB_tools/test/t_station_tests_watchdog.py
+++ b/LCU/Maintenance/MDB_tools/test/t_station_tests_watchdog.py
@@ -191,7 +191,7 @@ class TestStationTestsWatchdog(unittest.TestCase):
                                         mock_logging,
                                         partial_mock_sys):
         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_instantiate_file_creation_event_observer.return_value = mock_observer
 
-- 
GitLab