From af105971468b579c5cc073f695812af0bf93f526 Mon Sep 17 00:00:00 2001 From: Ainur Karimov Date: Mon, 16 Dec 2024 23:30:54 +0300 Subject: [PATCH] test back --- .../lightning_datamodules/test_rtk.py | 50 +++++++++---------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/tests/unit/datamodules/lightning_datamodules/test_rtk.py b/tests/unit/datamodules/lightning_datamodules/test_rtk.py index 2284445c..29f0bc9c 100644 --- a/tests/unit/datamodules/lightning_datamodules/test_rtk.py +++ b/tests/unit/datamodules/lightning_datamodules/test_rtk.py @@ -31,31 +31,31 @@ def test_DicomCocoComplexingDataModule(): assert k in batch -# def test_DicomCocoDataModuleRTK(): -# target_dir = "./data/rtk/infer" -# if os.path.exists(target_dir): -# shutil.rmtree(target_dir) -# -# path = {"source": rtk_segm, "target": target_dir} -# dm = DicomCocoDataModuleRTK(infer=path) -# dm.setup_infer() -# ds = dm.predict_dataloader() -# for batch in ds: -# break -# # for k in ["image", "path"]: -# # assert k in batch -# # -# -# def test_DicomCocoDataset_rtk(): -# """ -# import this test to run after previous -# """ -# path = "./data/rtk/infer" -# ds = DicomCocoDatasetRTK(data_dir=path) -# for batch in ds: -# break -# for k in ["image", "mask", "path"]: -# assert k in batch +def test_DicomCocoDataModuleRTK(): + target_dir = "./data/rtk/infer" + if os.path.exists(target_dir): + shutil.rmtree(target_dir) + + path = {"source": rtk_segm, "target": target_dir} + dm = DicomCocoDataModuleRTK(infer=path) + dm.setup_infer() + ds = dm.predict_dataloader() + for batch in ds: + break + for k in ["image", "path"]: + assert k in batch + + +def test_DicomCocoDataset_rtk(): + """ + import this test to run after previous + """ + path = "./data/rtk/infer" + ds = DicomCocoDatasetRTK(data_dir=path) + for batch in ds: + break + for k in ["image", "mask", "path"]: + assert k in batch # def test_datamodule_description():