diff --git a/tests/test_masked_inference_wsi_dataset.py b/tests/test_masked_inference_wsi_dataset.py index bb90f7900b..df0dafcbe2 100644 --- a/tests/test_masked_inference_wsi_dataset.py +++ b/tests/test_masked_inference_wsi_dataset.py @@ -27,11 +27,10 @@ _, has_cim = optional_import("cucim", name="CuImage") _, has_osl = optional_import("openslide") -FILE_KEY = "wsi_img" +FILE_KEY = "wsi_img.tiff" FILE_URL = testing_data_config("images", FILE_KEY, "url") -base_name, extension = os.path.basename(f"{FILE_URL}"), ".tiff" -FILE_NAME = f"temp_{base_name}" -FILE_PATH = os.path.join(os.path.dirname(__file__), "testing_data", FILE_NAME + extension) +FILE_NAME = f"temp_{FILE_KEY}" +FILE_PATH = os.path.join(os.path.dirname(__file__), "testing_data", FILE_NAME) MASK1, MASK2, MASK4 = "mask1.npy", "mask2.npy", "mask4.npy" diff --git a/tests/test_masked_patch_wsi_dataset.py b/tests/test_masked_patch_wsi_dataset.py index 730ce97bdb..b6cb006400 100644 --- a/tests/test_masked_patch_wsi_dataset.py +++ b/tests/test_masked_patch_wsi_dataset.py @@ -32,10 +32,9 @@ _, has_codec = optional_import("imagecodecs") has_tiff = has_tiff and has_codec -FILE_KEY = "wsi_img" +FILE_KEY = "wsi_img.tiff" FILE_URL = testing_data_config("images", FILE_KEY, "url") -base_name, extension = os.path.basename(f"{FILE_URL}"), ".tiff" -FILE_PATH = os.path.join(os.path.dirname(__file__), "testing_data", "temp_" + base_name + extension) +FILE_PATH = os.path.join(os.path.dirname(__file__), "testing_data", f"temp_{FILE_KEY}") TEST_CASE_0 = [ {"data": [{"image": FILE_PATH, WSIPatchKeys.LEVEL: 8, WSIPatchKeys.SIZE: (2, 2)}], "mask_level": 8}, diff --git a/tests/test_patch_wsi_dataset.py b/tests/test_patch_wsi_dataset.py index d2cc139ebc..6ad2fadf08 100644 --- a/tests/test_patch_wsi_dataset.py +++ b/tests/test_patch_wsi_dataset.py @@ -33,10 +33,9 @@ _, has_codec = optional_import("imagecodecs") has_tiff = has_tiff and has_codec -FILE_KEY = "wsi_img" +FILE_KEY = "wsi_img.tiff" FILE_URL = testing_data_config("images", FILE_KEY, "url") -base_name, extension = os.path.basename(f"{FILE_URL}"), ".tiff" -FILE_PATH = os.path.join(os.path.dirname(__file__), "testing_data", "temp_" + base_name + extension) +FILE_PATH = os.path.join(os.path.dirname(__file__), "testing_data", f"temp_{FILE_KEY}") TEST_CASE_DEP_0 = [ { diff --git a/tests/test_sliding_patch_wsi_dataset.py b/tests/test_sliding_patch_wsi_dataset.py index e6d11de739..c4e9c51381 100644 --- a/tests/test_sliding_patch_wsi_dataset.py +++ b/tests/test_sliding_patch_wsi_dataset.py @@ -32,10 +32,9 @@ _, has_codec = optional_import("imagecodecs") has_tiff = has_tiff and has_codec -FILE_KEY = "wsi_img" +FILE_KEY = "wsi_img.tiff" FILE_URL = testing_data_config("images", FILE_KEY, "url") -base_name, extension = os.path.basename(f"{FILE_URL}"), ".tiff" -FILE_PATH = os.path.join(os.path.dirname(__file__), "testing_data", "temp_" + base_name + extension) +FILE_PATH = os.path.join(os.path.dirname(__file__), "testing_data", f"temp_{FILE_KEY}") FILE_PATH_SMALL_0 = os.path.join(os.path.dirname(__file__), "testing_data", "temp_wsi_inference_0.tiff") FILE_PATH_SMALL_1 = os.path.join(os.path.dirname(__file__), "testing_data", "temp_wsi_inference_1.tiff") diff --git a/tests/test_smartcache_patch_wsi_dataset.py b/tests/test_smartcache_patch_wsi_dataset.py index e51033bb4e..5ae15cde5c 100644 --- a/tests/test_smartcache_patch_wsi_dataset.py +++ b/tests/test_smartcache_patch_wsi_dataset.py @@ -26,10 +26,9 @@ _cucim, has_cim = optional_import("cucim") has_cim = has_cim and hasattr(_cucim, "CuImage") -FILE_KEY = "wsi_img" +FILE_KEY = "wsi_img.tiff" FILE_URL = testing_data_config("images", FILE_KEY, "url") -base_name, extension = os.path.basename(f"{FILE_URL}"), ".tiff" -FILE_PATH = os.path.join(os.path.dirname(__file__), "testing_data", "temp_" + base_name + extension) +FILE_PATH = os.path.join(os.path.dirname(__file__), "testing_data", f"temp_{FILE_KEY}") TEST_CASE_0 = [ { diff --git a/tests/test_wsireader.py b/tests/test_wsireader.py index d435902c28..65c0e3388b 100644 --- a/tests/test_wsireader.py +++ b/tests/test_wsireader.py @@ -36,11 +36,9 @@ _, has_codec = optional_import("imagecodecs") has_tiff = has_tiff and has_codec -FILE_KEY = "wsi_img" +FILE_KEY = "wsi_img.tiff" FILE_URL = testing_data_config("images", FILE_KEY, "url") -base_name, extension = os.path.basename(f"{FILE_URL}"), ".tiff" -FILE_PATH = os.path.join(os.path.dirname(__file__), "testing_data", "temp_" + base_name + extension) - +FILE_PATH = os.path.join(os.path.dirname(__file__), "testing_data", f"temp_{FILE_KEY}") HEIGHT = 32914 WIDTH = 46000 diff --git a/tests/testing_data/data_config.json b/tests/testing_data/data_config.json index 788d664439..1a91986fd8 100644 --- a/tests/testing_data/data_config.json +++ b/tests/testing_data/data_config.json @@ -1,6 +1,6 @@ { "images": { - "wsi_img": { + "wsi_img.tiff": { "url": "https://github.com/Project-MONAI/MONAI-extra-test-data/releases/download/0.8.1/CMU-1.tiff", "hash_type": "sha256", "hash_val": "73a7e89bc15576587c3d68e55d9bf92f09690280166240b48ff4b48230b13bcd"