FAQ | This is a LIVE service | Changelog

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

more work on the epi test, still failing but commiting for jake

parent 736c9793
No related branches found
No related tags found
No related merge requests found
import os
import unittest
from integration.integration_test_utils import IntegrationTestUtils
from integration.test_deposition import TestDeposition
class DepoAsserts(TestDeposition):
def test_standard_run_input_status_success(self):
status_file_path = os.path.join(TestDeposition.TEST_OUT_PATH, TestDeposition.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_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(TestDeposition.TEST_OUT_PATH, TestDeposition.TEST_JOB_DIR,
"plotting", "eastafrica", "images", "Weekly",
"deposition_eastafrica_leaf_rust_total_202210010000_202210080000_map.png")
ethiopia_image_path = os.path.join(TestDeposition.TEST_OUT_PATH, TestDeposition.TEST_JOB_DIR,
"plotting", "ethiopia", "images", "Weekly",
"deposition_ethiopia_leaf_rust_total_202210010000_202210080000_map.png")
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)
def test_standard_run_all_input_csvs_produced(self):
east_africa_csv_path = os.path.join(TestDeposition.TEST_OUT_PATH, TestDeposition.TEST_JOB_DIR,
"plotting", "eastafrica", "input_csvs", "*.csv")
ethiopia_csv_path = os.path.join(TestDeposition.TEST_OUT_PATH, TestDeposition.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(9, ea_csv_count)
self.assertEqual(27, eth_csv_count)
def test_standard_run_all_images_produced(self):
east_africa_image_path = os.path.join(TestDeposition.TEST_OUT_PATH, TestDeposition.TEST_JOB_DIR,
"plotting", "eastafrica", "images", "Weekly", "*.png")
ethiopia_image_path = os.path.join(TestDeposition.TEST_OUT_PATH, TestDeposition.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(3, ea_csv_count)
self.assertEqual(6, eth_csv_count)
if __name__ == '__main__':
unittest.main()
...@@ -21,8 +21,8 @@ class TestEpi(unittest.TestCase): ...@@ -21,8 +21,8 @@ class TestEpi(unittest.TestCase):
@staticmethod @staticmethod
def write_temp_run_config_files(): def write_temp_run_config_files():
nowstring: str = IntegrationTestUtils.get_now_string() nowstring: str = IntegrationTestUtils.get_now_string()
prefix: str = "temp_epi_" + nowstring # prefix: str = "temp_epi_" + nowstring
# prefix: str = "" prefix: str = ""
default_config = IntegrationTestUtils.DEFAULT_CONFIG_FILE_PATH default_config = IntegrationTestUtils.DEFAULT_CONFIG_FILE_PATH
default_config_dict: dict = IntegrationTestUtils.load_json_file(default_config) default_config_dict: dict = IntegrationTestUtils.load_json_file(default_config)
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
"WorkspacePathout" : "../test_data/test_deployment/regions/EastAfrica/workspace/", "WorkspacePathout" : "../test_data/test_deployment/regions/EastAfrica/workspace/",
"WorkspacePath" : "set_in_the_code", "WorkspacePath" : "set_in_the_code",
"ResourcesPath" : "../test_data/test_deployment/regions/EastAfrica/resources/", "ResourcesPath" : "../test_data/test_deployment/regions/EastAfrica/resources/",
"ServerPath" : "/storage/moved/Ethiopia/", "ServerPath" : "OVERRIDDEN",
"ServerName" : "ewsmanager@willow.csx.cam.ac.uk", "ServerName" : "ewsmanager@willow.csx.cam.ac.uk",
"ServerKey" : "not used, set to empty string in tests", "ServerKey" : "not used, set to empty string in tests",
"Survey" : { "Survey" : {
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
"SeasonStartString" : "20220930", "SeasonStartString" : "20220930",
"SkipServerDownload" : true, "SkipServerDownload" : true,
"ServerCredentialsFile" : "../test_data/test_deployment/regions/EastAfrica/resources/coordinator/configs/Cred-ODK-EIAR.json", "ServerCredentialsFile" : "../test_data/test_deployment/regions/EastAfrica/resources/coordinator/configs/Cred-ODK-EIAR.json",
"ServerPathExtra" : "/storage/sftp/metofficeupload/upload/Ethiopia/toMO/", "ServerPathExtra" : "OVERRIDDEN",
"FormEdits" : { "FormEdits" : {
"wheat_rust_survey_1_0" : {}, "wheat_rust_survey_1_0" : {},
"akpyJHvYxkLKPkxFJnPyTW" : { "akpyJHvYxkLKPkxFJnPyTW" : {
...@@ -124,7 +124,7 @@ ...@@ -124,7 +124,7 @@
} }
}, },
"Deposition" : { "Deposition" : {
"ServerPathTemplate" : "/storage/sftp/metofficeupload/upload/Ethiopia/fromMO/daily_name/", "ServerPathTemplate" : "OVERRIDDEN",
"InputFileTemplate" : "WR_NAME_Ethiopia_${StartString}_fc", "InputFileTemplate" : "WR_NAME_Ethiopia_${StartString}_fc",
"DataFileTemplate" : "deposition_srcs_allregions_${StartString}.nc", "DataFileTemplate" : "deposition_srcs_allregions_${StartString}.nc",
"TimeExpectedAvailable" : "0800", "TimeExpectedAvailable" : "0800",
......
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