FAQ | This is a LIVE service | Changelog

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

adding advisory test

parent aa2603b3
No related branches found
No related tags found
No related merge requests found
...@@ -56,3 +56,4 @@ test: ...@@ -56,3 +56,4 @@ test:
- python3 -m unittest test_deposition.py - python3 -m unittest test_deposition.py
- python3 -m unittest test_env_suit.py - python3 -m unittest test_env_suit.py
- python3 -m unittest test_survey.py - python3 -m unittest test_survey.py
- python3 -m unittest test_advisory.py
...@@ -7,6 +7,8 @@ class IntegrationTestUtils: ...@@ -7,6 +7,8 @@ class IntegrationTestUtils:
TEMP_CONFIG_FILE_PATH: str = "../test_data/test_deployment/regions/EastAfrica/workspace/temp_config.json" TEMP_CONFIG_FILE_PATH: str = "../test_data/test_deployment/regions/EastAfrica/workspace/temp_config.json"
EXAMPLE_SURVEY_FILE_PATH: str = "../test_data/test_deployment/regions/EastAfrica/resources/coordinator/assets/example_survey_run.zip" EXAMPLE_SURVEY_FILE_PATH: str = "../test_data/test_deployment/regions/EastAfrica/resources/coordinator/assets/example_survey_run.zip"
EXAMPLE_DEPO_FILE_PATH: str = "../test_data/test_deployment/regions/EastAfrica/resources/coordinator/assets/example_depo_run.zip"
EXAMPLE_ENV_SUIT_FILE_PATH: str = "../test_data/test_deployment/regions/EastAfrica/resources/coordinator/assets/example_env_suit_run.zip"
@staticmethod @staticmethod
def load_json_file(file: str) -> dict: def load_json_file(file: str) -> dict:
......
import copy
import os
import unittest
from integration.integration_test_utils import IntegrationTestUtils
class TestEnvSuit(unittest.TestCase):
def setUp(self) -> None:
super().setUp()
default_config = '../test_data/test_deployment/regions/EastAfrica/resources/coordinator/configs/config_EastAfrica_fc_live.json'
self.default_config_dict: dict = IntegrationTestUtils.load_json_file(default_config)
def test_env_suit_standard_inputs_expected_results1(self):
nowstring: str = IntegrationTestUtils.get_now_string()
prefix: str = "temp_advisory_" + nowstring
# prefix: str = ""
os.environ["EMAIL_CRED"] = "../test_data/test_deployment/envs/Cred_gmail.json"
from Processor import run_Process, set_log_level
args_dict: dict = {}
args_dict['component'] = 'Advisory'
args_dict['config_paths'] = [IntegrationTestUtils.TEMP_CONFIG_FILE_PATH]
args_dict['log_level'] = 'info'
args_dict['live'] = False
args_dict['start_date'] = '20221001'
args_dict['noupload'] = True
set_log_level(args_dict['log_level'])
run_dict: dict = copy.deepcopy(self.default_config_dict)
test_out_path = run_dict['WorkspacePathout'] + prefix + os.sep
run_dict['WorkspacePathout'] = test_out_path
run_dict['WorkspacePath'] = test_out_path
run_dict['ServerName'] = '' # nothing, as local machine
IntegrationTestUtils.write_json_file(run_dict, IntegrationTestUtils.TEMP_CONFIG_FILE_PATH)
IntegrationTestUtils.unpack_zip(IntegrationTestUtils.EXAMPLE_SURVEY_FILE_PATH, test_out_path)
IntegrationTestUtils.unpack_zip(IntegrationTestUtils.EXAMPLE_DEPO_FILE_PATH, test_out_path)
IntegrationTestUtils.unpack_zip(IntegrationTestUtils.EXAMPLE_ENV_SUIT_FILE_PATH, test_out_path)
run_Process(args_dict)
self.assertTrue(True)
if __name__ == '__main__':
unittest.main()
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