diff --git a/tests/integration/full/full_test_env_suit.py b/tests/integration/full/full_test_env_suit.py index 9d728d7136150c445d009106379a94617b758e14..a88ea236330240af710bb96a9f462be54c95b15d 100644 --- a/tests/integration/full/full_test_env_suit.py +++ b/tests/integration/full/full_test_env_suit.py @@ -12,8 +12,10 @@ from integration.test_suites.env_suit_test_suite import BaseEnvSuitTestSuite class FullTestEnvSuit(BaseEnvSuitTestSuite.EnvSuitTestSuite): def set_expected_values(self): - pass - + self.EA_CSV_COUNT: int = 18 + self.ETH_CSV_COUNT: int = 18 + self.EA_PNG_COUNT: int = 6 + self.ETH_PNG_COUNT: int = 6 def setUp(self) -> None: @@ -51,56 +53,6 @@ class FullTestEnvSuit(BaseEnvSuitTestSuite.EnvSuitTestSuite): IntegrationTestUtils.EMAIL_CRED_PATH) - # def test_standard_run_input_status_success(self): - # status_file_path = os.path.join(FullTestEnvSuit.TEST_OUT_PATH, FullTestEnvSuit.TEST_JOB_DIR, "STATUS_SUCCESS") - # print(f"looking for {status_file_path}") - # success_file_exists: bool = os.path.isfile(status_file_path) - # self.assertTrue(success_file_exists) - # - # - # def test_standard_run_input_all_regions_ran(self): - # """ - # working on the assumption that if there are images for each region, it must have run through - # (at least past the region iteration) - # """ - # - # east_africa_image_path = os.path.join(FullTestEnvSuit.TEST_OUT_PATH, FullTestEnvSuit.TEST_JOB_DIR, - # "plotting", "eastafrica", "images", "Weekly", - # "suitability_eastafrica_leaf_rust_total_*_map.png") - # ethiopia_image_path = os.path.join(FullTestEnvSuit.TEST_OUT_PATH, FullTestEnvSuit.TEST_JOB_DIR, - # "plotting", "ethiopia", "images", "Weekly", - # "suitability_ethiopia_leaf_rust_total_*_map.png") - # - # ea_file_exists: bool = len(glob.glob(east_africa_image_path)) > 0 - # eth_file_exists: bool = len(glob.glob(ethiopia_image_path)) > 0 - # self.assertTrue(ea_file_exists) - # self.assertTrue(eth_file_exists) - # - # - # def test_standard_run_all_input_csvs_produced(self): - # east_africa_csv_path = os.path.join(FullTestEnvSuit.TEST_OUT_PATH, FullTestEnvSuit.TEST_JOB_DIR, - # "plotting", "eastafrica", "input_csvs", "*.csv") - # ethiopia_csv_path = os.path.join(FullTestEnvSuit.TEST_OUT_PATH, FullTestEnvSuit.TEST_JOB_DIR, - # "plotting", "ethiopia", "input_csvs", "*.csv") - # - # ea_csv_count: int = IntegrationTestUtils.count_files_in_wildcard(east_africa_csv_path) - # eth_csv_count: int = IntegrationTestUtils.count_files_in_wildcard(ethiopia_csv_path) - # self.assertEqual(18, ea_csv_count) - # self.assertEqual(18, eth_csv_count) - # - # - # def test_standard_run_all_images_produced(self): - # east_africa_image_path = os.path.join(FullTestEnvSuit.TEST_OUT_PATH, FullTestEnvSuit.TEST_JOB_DIR, - # "plotting", "eastafrica", "images", "Weekly", "*.png") - # ethiopia_image_path = os.path.join(FullTestEnvSuit.TEST_OUT_PATH, FullTestEnvSuit.TEST_JOB_DIR, - # "plotting", "ethiopia", "images", "Weekly", "*.png") - # - # ea_csv_count: int = IntegrationTestUtils.count_files_in_wildcard(east_africa_image_path) - # eth_csv_count: int = IntegrationTestUtils.count_files_in_wildcard(ethiopia_image_path) - # self.assertEqual(6, ea_csv_count) - # self.assertEqual(6, eth_csv_count) - - if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument('--config', required = True) diff --git a/tests/integration/partial/test_survey.py b/tests/integration/partial/test_survey.py index 704a5d633bf675352dbc0e566dd567182e67ce70..2653cb24aee09da91691379fb963ba9afc016381 100644 --- a/tests/integration/partial/test_survey.py +++ b/tests/integration/partial/test_survey.py @@ -5,7 +5,7 @@ import unittest from integration.partial.integration_test_utils import IntegrationTestUtils -class TestSurvey(unittest.TestCase): +class TestSurvey(BaseEnvSuitTestSuite.EnvSuitTestSuite): TEST_OUT_PATH: str = "not_set" TEST_START_DATE: str = '20221001' diff --git a/tests/integration/test_suites/depo_test_suite.py b/tests/integration/test_suites/depo_test_suite.py index b81bbe1b1ab5283e9ef9b0a254ad0e06cc5ead90..2d0e9cd9bb0ae62761ff581a25fb5415d3cb48aa 100644 --- a/tests/integration/test_suites/depo_test_suite.py +++ b/tests/integration/test_suites/depo_test_suite.py @@ -21,24 +21,16 @@ class BaseDepoTestSuite: TEST_JOB_DIR: str = None - def __init__(self, methodName: str = ...) -> None: - super().__init__(methodName) - + @abc.abstractmethod + def set_expected_values(self): """ - these fields need to be overridden in the tests that use this test suite, override the - 'set_expected_values' function below + these fields need to be overridden in the tests that use this test suite """ self.EA_CSV_COUNT: int = 0 self.ETH_CSV_COUNT: int = 0 self.EA_PNG_COUNT: int = 0 self.ETH_PNG_COUNT: int = 0 - - @abc.abstractmethod - def set_expected_values(self): - return - - def test_standard_run_input_status_success(self): status_file_path = os.path.join(BaseDepoTestSuite.DepoTestSuite.TEST_OUT_PATH, BaseDepoTestSuite.DepoTestSuite.TEST_JOB_DIR, diff --git a/tests/integration/test_suites/env_suit_test_suite.py b/tests/integration/test_suites/env_suit_test_suite.py index b6a20d878e28e021a601c00823201cf445d9a985..800625d56d2f1d51b35e65255fe0dd5de5c1be5e 100644 --- a/tests/integration/test_suites/env_suit_test_suite.py +++ b/tests/integration/test_suites/env_suit_test_suite.py @@ -20,19 +20,17 @@ class BaseEnvSuitTestSuite: TEST_START_DATE: str = None TEST_JOB_DIR: str = None - """ - these fields need to be overridden in the tests that use this test suite, override the - 'set_expected_values' function below - """ - EA_CSV_COUNT: int = None - ETH_CSV_COUNT: int = None - EA_PNG_COUNT: int = None - ETH_PNG_COUNT: int = None - @abc.abstractmethod def set_expected_values(self): - return + """ + these fields need to be overridden in the tests that use this test suite + """ + + self.EA_CSV_COUNT: int = 0 + self.ETH_CSV_COUNT: int = 0 + self.EA_PNG_COUNT: int = 0 + self.ETH_PNG_COUNT: int = 0 def test_standard_run_input_status_success(self):