FAQ | This is a LIVE service | Changelog

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

updating epi test

parent df4f1646
No related branches found
No related tags found
No related merge requests found
import copy
import os
import unittest
from integration.integration_test_utils import IntegrationTestUtils
class TestEpi(unittest.TestCase):
TEST_OUT_PATH: str = "not_set"
TEST_START_DATE: str = '20221001'
TEST_JOB_DIR: str = "SUMMARY_" + TEST_START_DATE
@classmethod
def setUpClass(cls) -> None:
TestEpi.write_temp_run_config_files()
TestEpi.unpack_dependencies()
TestEpi.run_advisory_pipeline()
@staticmethod
def write_temp_run_config_files():
nowstring: str = IntegrationTestUtils.get_now_string()
prefix: str = "temp_epi_" + nowstring
# prefix: str = ""
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)
TestEpi.TEST_OUT_PATH = run_dict['WorkspacePathout'] + prefix + os.sep
run_dict['WorkspacePathout'] = TestEpi.TEST_OUT_PATH
run_dict['WorkspacePath'] = TestEpi.TEST_OUT_PATH
run_dict['ServerName'] = '' # nothing, as local machine
IntegrationTestUtils.write_json_file(run_dict, IntegrationTestUtils.TEMP_CONFIG_FILE_PATH)
@staticmethod
def unpack_dependencies():
IntegrationTestUtils.unpack_zip(IntegrationTestUtils.EXAMPLE_SURVEY_FILE_PATH, TestEpi.TEST_OUT_PATH)
IntegrationTestUtils.unpack_zip(IntegrationTestUtils.EXAMPLE_DEPO_FILE_PATH, TestEpi.TEST_OUT_PATH)
IntegrationTestUtils.unpack_zip(IntegrationTestUtils.EXAMPLE_ENV_SUIT_FILE_PATH, TestEpi.TEST_OUT_PATH)
@staticmethod
def run_advisory_pipeline():
component = 'Epidemiology'
IntegrationTestUtils.run_pipeline(component, TestEpi.TEST_START_DATE)
def test_standard_run_input_status_success(self):
status_file_path = os.path.join(TestEpi.TEST_OUT_PATH, TestEpi.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(TestEpi.TEST_OUT_PATH, TestEpi.TEST_JOB_DIR,
"tight-layout",
"wheat_rust_advisory_template_EastAfrica_20221001.docx")
ethiopia_image_path = os.path.join(TestEpi.TEST_OUT_PATH, TestEpi.TEST_JOB_DIR,
"tight-layout",
"wheat_rust_advisory_template_Ethiopia_20221001.docx")
ea_file_exists: bool = os.path.isfile(east_africa_image_path)
eth_file_exists: bool = os.path.isfile(ethiopia_image_path)
self.assertTrue(ea_file_exists)
self.assertTrue(eth_file_exists)
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