diff --git a/tests/integration/test_advisory.py b/tests/integration/test_advisory.py index 4c96d87d0e9eb3d6ce5212b5a64de03371f271cf..ea238a9be6fb26f479e30f7122e1f75b2c64c87a 100644 --- a/tests/integration/test_advisory.py +++ b/tests/integration/test_advisory.py @@ -5,7 +5,7 @@ import unittest from integration.integration_test_utils import IntegrationTestUtils -class TestEnvSuit(unittest.TestCase): +class TestAdvisory(unittest.TestCase): TEST_OUT_PATH: str = "not_set" TEST_RUN_DATE: str = '20221001' @@ -13,8 +13,8 @@ class TestEnvSuit(unittest.TestCase): @classmethod def setUpClass(cls) -> None: - TestEnvSuit.write_temp_run_config_file() - TestEnvSuit.run_advisory_pipeline() + TestAdvisory.write_temp_run_config_file() + TestAdvisory.run_advisory_pipeline() @staticmethod @@ -26,9 +26,9 @@ class TestEnvSuit(unittest.TestCase): default_config = IntegrationTestUtils.DEFAULT_CONFIG_FILE_PATH default_config_dict: dict = IntegrationTestUtils.load_json_file(default_config) run_dict: dict = copy.deepcopy(default_config_dict) - TestEnvSuit.TEST_OUT_PATH = run_dict['WorkspacePathout'] + prefix + os.sep - run_dict['WorkspacePathout'] = TestEnvSuit.TEST_OUT_PATH - run_dict['WorkspacePath'] = TestEnvSuit.TEST_OUT_PATH + TestAdvisory.TEST_OUT_PATH = run_dict['WorkspacePathout'] + prefix + os.sep + run_dict['WorkspacePathout'] = TestAdvisory.TEST_OUT_PATH + run_dict['WorkspacePath'] = TestAdvisory.TEST_OUT_PATH run_dict['ServerName'] = '' # nothing, as local machine IntegrationTestUtils.write_json_file(run_dict, IntegrationTestUtils.TEMP_CONFIG_FILE_PATH) @@ -43,27 +43,27 @@ class TestEnvSuit(unittest.TestCase): 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['start_date'] = TestAdvisory.TEST_RUN_DATE args_dict['noupload'] = True set_log_level(args_dict['log_level']) - IntegrationTestUtils.unpack_zip(IntegrationTestUtils.EXAMPLE_SURVEY_FILE_PATH, TestEnvSuit.TEST_OUT_PATH) - IntegrationTestUtils.unpack_zip(IntegrationTestUtils.EXAMPLE_DEPO_FILE_PATH, TestEnvSuit.TEST_OUT_PATH) - IntegrationTestUtils.unpack_zip(IntegrationTestUtils.EXAMPLE_ENV_SUIT_FILE_PATH, TestEnvSuit.TEST_OUT_PATH) + IntegrationTestUtils.unpack_zip(IntegrationTestUtils.EXAMPLE_SURVEY_FILE_PATH, TestAdvisory.TEST_OUT_PATH) + IntegrationTestUtils.unpack_zip(IntegrationTestUtils.EXAMPLE_DEPO_FILE_PATH, TestAdvisory.TEST_OUT_PATH) + IntegrationTestUtils.unpack_zip(IntegrationTestUtils.EXAMPLE_ENV_SUIT_FILE_PATH, TestAdvisory.TEST_OUT_PATH) run_Process(args_dict) def test_standard_run_input_status_success(self): - status_file_path = os.path.join(TestEnvSuit.TEST_OUT_PATH, TestEnvSuit.TEST_JOB_DIR, "STATUS_SUCCESS") + status_file_path = os.path.join(TestAdvisory.TEST_OUT_PATH, TestAdvisory.TEST_JOB_DIR, "STATUS_SUCCESS") success_file_exists: bool = os.path.isfile(status_file_path) self.assertTrue(success_file_exists) def test_standard_run_input_all_docs_produced(self): - east_africa_image_path = os.path.join(TestEnvSuit.TEST_OUT_PATH, TestEnvSuit.TEST_JOB_DIR, + east_africa_image_path = os.path.join(TestAdvisory.TEST_OUT_PATH, TestAdvisory.TEST_JOB_DIR, "tight-layout", "wheat_rust_advisory_template_EastAfrica_20221001.docx") - ethiopia_image_path = os.path.join(TestEnvSuit.TEST_OUT_PATH, TestEnvSuit.TEST_JOB_DIR, + ethiopia_image_path = os.path.join(TestAdvisory.TEST_OUT_PATH, TestAdvisory.TEST_JOB_DIR, "tight-layout", "wheat_rust_advisory_template_Ethiopia_20221001.docx") diff --git a/tests/integration/test_env_suit.py b/tests/integration/test_env_suit.py index 4215261e907e65c66d201b07835464d6109b69c7..85085e6b14df58239f7ee6f47783e5bd9240e476 100644 --- a/tests/integration/test_env_suit.py +++ b/tests/integration/test_env_suit.py @@ -49,7 +49,7 @@ class TestEnvSuit(unittest.TestCase): args_dict['config_paths'] = [IntegrationTestUtils.TEMP_CONFIG_FILE_PATH] args_dict['log_level'] = 'error' args_dict['live'] = False - args_dict['start_date'] = '20221001' + args_dict['start_date'] = TestEnvSuit.TEST_RUN_DATE args_dict['noupload'] = True set_log_level(args_dict['log_level']) diff --git a/tests/integration/test_survey.py b/tests/integration/test_survey.py index 8464688ccd152cf963decd9f136d99395e4124c2..0dbb692ad9c4027a6466a6dbaf620dd03ad6c2d3 100644 --- a/tests/integration/test_survey.py +++ b/tests/integration/test_survey.py @@ -44,7 +44,7 @@ class TestSurvey(unittest.TestCase): 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['start_date'] = TestSurvey.TEST_RUN_DATE args_dict['noupload'] = True set_log_level(args_dict['log_level'])