Skip to content

Commit f8ad6c6

Browse files
authored
5164 fixes wsireader test (#5165)
Fixes #5164 ### Description fixes file path tests ### Types of changes <!--- Put an `x` in all the boxes that apply, and remove the not applicable items --> - [x] Non-breaking change (fix or new feature that would not break existing functionality). - [x] Quick tests passed locally by running `./runtests.sh --quick --unittests --disttests`. Signed-off-by: Wenqi Li <[email protected]>
1 parent 70c0443 commit f8ad6c6

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Diff for: tests/test_wsireader.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ def test_read_whole_image(self, file_path, level, expected_shape):
280280
img, meta = reader.get_data(img_obj)
281281
self.assertTupleEqual(img.shape, expected_shape)
282282
self.assertEqual(meta["backend"], self.backend)
283-
self.assertEqual(meta[WSIPatchKeys.PATH], str(os.path.abspath(file_path)))
283+
self.assertEqual(meta[WSIPatchKeys.PATH].lower(), str(os.path.abspath(file_path)).lower())
284284
self.assertEqual(meta[WSIPatchKeys.LEVEL], level)
285285
assert_array_equal(meta[WSIPatchKeys.SIZE], expected_shape[1:])
286286
assert_array_equal(meta[WSIPatchKeys.LOCATION], (0, 0))
@@ -300,7 +300,7 @@ def test_read_region(self, file_path, kwargs, patch_info, expected_img):
300300
self.assertTupleEqual(img.shape, expected_img.shape)
301301
self.assertIsNone(assert_array_equal(img, expected_img))
302302
self.assertEqual(meta["backend"], self.backend)
303-
self.assertEqual(meta[WSIPatchKeys.PATH], str(os.path.abspath(file_path)))
303+
self.assertEqual(meta[WSIPatchKeys.PATH].lower(), str(os.path.abspath(file_path)).lower())
304304
self.assertEqual(meta[WSIPatchKeys.LEVEL], level)
305305
assert_array_equal(meta[WSIPatchKeys.SIZE], patch_info["size"])
306306
assert_array_equal(meta[WSIPatchKeys.LOCATION], patch_info["location"])
@@ -320,7 +320,7 @@ def test_read_region_multi_wsi(self, file_path_list, patch_info, expected_img):
320320
self.assertTupleEqual(img.shape, expected_img.shape)
321321
self.assertIsNone(assert_array_equal(img, expected_img))
322322
self.assertEqual(meta["backend"], self.backend)
323-
self.assertEqual(meta[WSIPatchKeys.PATH][0], str(os.path.abspath(file_path_list[0])))
323+
self.assertEqual(meta[WSIPatchKeys.PATH][0].lower(), str(os.path.abspath(file_path_list[0])).lower())
324324
self.assertEqual(meta[WSIPatchKeys.LEVEL][0], patch_info["level"])
325325
assert_array_equal(meta[WSIPatchKeys.SIZE][0], expected_img.shape[1:])
326326
assert_array_equal(meta[WSIPatchKeys.LOCATION][0], patch_info["location"])
@@ -397,7 +397,7 @@ def test_read_whole_image_multi_thread(self, file_path, level, expected_shape):
397397
img, meta = reader.get_data(img_obj)
398398
self.assertTupleEqual(img.shape, expected_shape)
399399
self.assertEqual(meta["backend"], self.backend)
400-
self.assertEqual(meta[WSIPatchKeys.PATH], str(os.path.abspath(file_path)))
400+
self.assertEqual(meta[WSIPatchKeys.PATH].lower(), str(os.path.abspath(file_path)).lower())
401401
self.assertEqual(meta[WSIPatchKeys.LEVEL], level)
402402
assert_array_equal(meta[WSIPatchKeys.SIZE], expected_shape[1:])
403403
assert_array_equal(meta[WSIPatchKeys.LOCATION], (0, 0))
@@ -415,7 +415,7 @@ def test_read_region_multi_thread(self, file_path, kwargs, patch_info, expected_
415415
self.assertTupleEqual(img.shape, expected_img.shape)
416416
self.assertIsNone(assert_array_equal(img, expected_img))
417417
self.assertEqual(meta["backend"], self.backend)
418-
self.assertEqual(meta[WSIPatchKeys.PATH], str(os.path.abspath(file_path)))
418+
self.assertEqual(meta[WSIPatchKeys.PATH].lower(), str(os.path.abspath(file_path)).lower())
419419
self.assertEqual(meta[WSIPatchKeys.LEVEL], patch_info["level"])
420420
assert_array_equal(meta[WSIPatchKeys.SIZE], patch_info["size"])
421421
assert_array_equal(meta[WSIPatchKeys.LOCATION], patch_info["location"])

0 commit comments

Comments
 (0)