From d5b38cbac664bc3b698a855cb8cc5cf0dc3a3db0 Mon Sep 17 00:00:00 2001 From: Nic Ma Date: Fri, 5 Nov 2021 18:45:52 +0800 Subject: [PATCH] [DLMED] fix cuCIM tests Signed-off-by: Nic Ma --- tests/test_cuimage_reader.py | 3 ++- tests/test_masked_inference_wsi_dataset.py | 2 +- tests/test_openslide_reader.py | 3 ++- tests/test_patch_wsi_dataset.py | 3 ++- tests/test_smartcache_patch_wsi_dataset.py | 3 ++- 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/tests/test_cuimage_reader.py b/tests/test_cuimage_reader.py index c8391939f1..80820648ef 100644 --- a/tests/test_cuimage_reader.py +++ b/tests/test_cuimage_reader.py @@ -26,7 +26,8 @@ PILImage, has_pil = optional_import("PIL.Image") FILE_URL = "https://drive.google.com/uc?id=1sGTKZlJBIz53pfqTxoTqiIQzIoEzHLAe" -FILE_PATH = os.path.join(os.path.dirname(__file__), "testing_data", "temp_" + os.path.basename(FILE_URL)) +base_name, extension = FILE_URL.split("id=")[1], ".tiff" +FILE_PATH = os.path.join(os.path.dirname(__file__), "testing_data", "temp_" + base_name + extension) HEIGHT = 32914 WIDTH = 46000 diff --git a/tests/test_masked_inference_wsi_dataset.py b/tests/test_masked_inference_wsi_dataset.py index f5b2611fd9..576b4c85f4 100644 --- a/tests/test_masked_inference_wsi_dataset.py +++ b/tests/test_masked_inference_wsi_dataset.py @@ -26,7 +26,7 @@ _, has_osl = optional_import("openslide") FILE_URL = "https://drive.google.com/uc?id=1sGTKZlJBIz53pfqTxoTqiIQzIoEzHLAe" -base_name, extension = os.path.splitext(os.path.basename(FILE_URL)) +base_name, extension = FILE_URL.split("id=")[1], ".tiff" FILE_NAME = "temp_" + base_name FILE_PATH = os.path.join(os.path.dirname(__file__), "testing_data", FILE_NAME + extension) diff --git a/tests/test_openslide_reader.py b/tests/test_openslide_reader.py index cf092158f2..55e49fcb28 100644 --- a/tests/test_openslide_reader.py +++ b/tests/test_openslide_reader.py @@ -25,7 +25,8 @@ FILE_URL = "https://drive.google.com/uc?id=1sGTKZlJBIz53pfqTxoTqiIQzIoEzHLAe" -FILE_PATH = os.path.join(os.path.dirname(__file__), "testing_data", "temp_" + os.path.basename(FILE_URL)) +base_name, extension = FILE_URL.split("id=")[1], ".tiff" +FILE_PATH = os.path.join(os.path.dirname(__file__), "testing_data", "temp_" + base_name + extension) HEIGHT = 32914 WIDTH = 46000 diff --git a/tests/test_patch_wsi_dataset.py b/tests/test_patch_wsi_dataset.py index 9259cd0e7b..ca54332ad5 100644 --- a/tests/test_patch_wsi_dataset.py +++ b/tests/test_patch_wsi_dataset.py @@ -26,7 +26,8 @@ _, has_osl = optional_import("openslide") FILE_URL = "https://drive.google.com/uc?id=1sGTKZlJBIz53pfqTxoTqiIQzIoEzHLAe" -FILE_PATH = os.path.join(os.path.dirname(__file__), "testing_data", "temp_" + os.path.basename(FILE_URL)) +base_name, extension = FILE_URL.split("id=")[1], ".tiff" +FILE_PATH = os.path.join(os.path.dirname(__file__), "testing_data", "temp_" + base_name + extension) TEST_CASE_0 = [ { diff --git a/tests/test_smartcache_patch_wsi_dataset.py b/tests/test_smartcache_patch_wsi_dataset.py index 317b6cba63..2150ede51c 100644 --- a/tests/test_smartcache_patch_wsi_dataset.py +++ b/tests/test_smartcache_patch_wsi_dataset.py @@ -25,7 +25,8 @@ has_cim = has_cim and hasattr(_cucim, "CuImage") FILE_URL = "https://drive.google.com/uc?id=1sGTKZlJBIz53pfqTxoTqiIQzIoEzHLAe" -FILE_PATH = os.path.join(os.path.dirname(__file__), "testing_data", "temp_" + os.path.basename(FILE_URL)) +base_name, extension = FILE_URL.split("id=")[1], ".tiff" +FILE_PATH = os.path.join(os.path.dirname(__file__), "testing_data", "temp_" + base_name + extension) TEST_CASE_0 = [ {