FAQ | This is a LIVE service | Changelog

Skip to content
Snippets Groups Projects
Commit 741453cf authored by L. Bower's avatar L. Bower
Browse files

adding test utils

parent 0a5e7e11
No related branches found
No related tags found
No related merge requests found
...@@ -4,6 +4,8 @@ from datetime import datetime ...@@ -4,6 +4,8 @@ from datetime import datetime
class IntegrationTestUtils: class IntegrationTestUtils:
TEMP_CONFIG_FILE_PATH: str = "../test_data/test_deployment/regions/EastAfrica/workspace/temp_config.json"
@staticmethod @staticmethod
def load_json_file(file: str) -> dict: def load_json_file(file: str) -> dict:
with open(file) as config_file: with open(file) as config_file:
......
...@@ -7,8 +7,6 @@ from integration.integration_test_utils import IntegrationTestUtils ...@@ -7,8 +7,6 @@ from integration.integration_test_utils import IntegrationTestUtils
class TestDeposition(unittest.TestCase): class TestDeposition(unittest.TestCase):
TEMP_CONFIG_FILE_PATH: str = "../test_data/test_deployment/regions/EastAfrica/workspace/temp_config.json"
def setUp(self) -> None: def setUp(self) -> None:
super().setUp() super().setUp()
default_config = '../test_data/test_deployment/regions/EastAfrica/resources/coordinator/configs/config_EastAfrica_fc_live.json' default_config = '../test_data/test_deployment/regions/EastAfrica/resources/coordinator/configs/config_EastAfrica_fc_live.json'
...@@ -23,7 +21,7 @@ class TestDeposition(unittest.TestCase): ...@@ -23,7 +21,7 @@ class TestDeposition(unittest.TestCase):
from Processor import run_Process, set_log_level from Processor import run_Process, set_log_level
args_dict: dict = {} args_dict: dict = {}
args_dict['component'] = 'Deposition' args_dict['component'] = 'Deposition'
args_dict['config_paths'] = [TestDeposition.TEMP_CONFIG_FILE_PATH] args_dict['config_paths'] = [IntegrationTestUtils.TEMP_CONFIG_FILE_PATH]
args_dict['log_level'] = 'error' args_dict['log_level'] = 'error'
args_dict['live'] = False args_dict['live'] = False
args_dict['start_date'] = '20221001' args_dict['start_date'] = '20221001'
...@@ -40,7 +38,7 @@ class TestDeposition(unittest.TestCase): ...@@ -40,7 +38,7 @@ class TestDeposition(unittest.TestCase):
run_dict['SubRegionNames'].remove('Kenya') run_dict['SubRegionNames'].remove('Kenya')
run_dict['Deposition']['EWS-Plotting'].pop('Kenya', None) run_dict['Deposition']['EWS-Plotting'].pop('Kenya', None)
IntegrationTestUtils.write_json_file(run_dict, self.TEMP_CONFIG_FILE_PATH) IntegrationTestUtils.write_json_file(run_dict, IntegrationTestUtils.TEMP_CONFIG_FILE_PATH)
run_Process(args_dict) run_Process(args_dict)
self.assertTrue(True) self.assertTrue(True)
......
...@@ -3,7 +3,6 @@ import os ...@@ -3,7 +3,6 @@ import os
import unittest import unittest
from integration.integration_test_utils import IntegrationTestUtils from integration.integration_test_utils import IntegrationTestUtils
from integration.test_deposition import TestDeposition
class TestEnvSuit(unittest.TestCase): class TestEnvSuit(unittest.TestCase):
...@@ -21,7 +20,7 @@ class TestEnvSuit(unittest.TestCase): ...@@ -21,7 +20,7 @@ class TestEnvSuit(unittest.TestCase):
from Processor import run_Process, set_log_level from Processor import run_Process, set_log_level
args_dict: dict = {} args_dict: dict = {}
args_dict['component'] = 'Environment' args_dict['component'] = 'Environment'
args_dict['config_paths'] = [TestDeposition.TEMP_CONFIG_FILE_PATH] args_dict['config_paths'] = [IntegrationTestUtils.TEMP_CONFIG_FILE_PATH]
args_dict['log_level'] = 'error' args_dict['log_level'] = 'error'
args_dict['live'] = False args_dict['live'] = False
args_dict['start_date'] = '20221001' args_dict['start_date'] = '20221001'
...@@ -41,7 +40,7 @@ class TestEnvSuit(unittest.TestCase): ...@@ -41,7 +40,7 @@ class TestEnvSuit(unittest.TestCase):
run_dict['SubRegionNames'].remove('Kenya') run_dict['SubRegionNames'].remove('Kenya')
IntegrationTestUtils.write_json_file(run_dict, TestDeposition.TEMP_CONFIG_FILE_PATH) IntegrationTestUtils.write_json_file(run_dict, IntegrationTestUtils.TEMP_CONFIG_FILE_PATH)
run_Process(args_dict) run_Process(args_dict)
self.assertTrue(True) self.assertTrue(True)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment