Skip to content

Commit

Permalink
5164 fixes wsireader test (#5165)
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
wyli authored Sep 16, 2022
1 parent 70c0443 commit f8ad6c6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/test_wsireader.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ def test_read_whole_image(self, file_path, level, expected_shape):
img, meta = reader.get_data(img_obj)
self.assertTupleEqual(img.shape, expected_shape)
self.assertEqual(meta["backend"], self.backend)
self.assertEqual(meta[WSIPatchKeys.PATH], str(os.path.abspath(file_path)))
self.assertEqual(meta[WSIPatchKeys.PATH].lower(), str(os.path.abspath(file_path)).lower())
self.assertEqual(meta[WSIPatchKeys.LEVEL], level)
assert_array_equal(meta[WSIPatchKeys.SIZE], expected_shape[1:])
assert_array_equal(meta[WSIPatchKeys.LOCATION], (0, 0))
Expand All @@ -300,7 +300,7 @@ def test_read_region(self, file_path, kwargs, patch_info, expected_img):
self.assertTupleEqual(img.shape, expected_img.shape)
self.assertIsNone(assert_array_equal(img, expected_img))
self.assertEqual(meta["backend"], self.backend)
self.assertEqual(meta[WSIPatchKeys.PATH], str(os.path.abspath(file_path)))
self.assertEqual(meta[WSIPatchKeys.PATH].lower(), str(os.path.abspath(file_path)).lower())
self.assertEqual(meta[WSIPatchKeys.LEVEL], level)
assert_array_equal(meta[WSIPatchKeys.SIZE], patch_info["size"])
assert_array_equal(meta[WSIPatchKeys.LOCATION], patch_info["location"])
Expand All @@ -320,7 +320,7 @@ def test_read_region_multi_wsi(self, file_path_list, patch_info, expected_img):
self.assertTupleEqual(img.shape, expected_img.shape)
self.assertIsNone(assert_array_equal(img, expected_img))
self.assertEqual(meta["backend"], self.backend)
self.assertEqual(meta[WSIPatchKeys.PATH][0], str(os.path.abspath(file_path_list[0])))
self.assertEqual(meta[WSIPatchKeys.PATH][0].lower(), str(os.path.abspath(file_path_list[0])).lower())
self.assertEqual(meta[WSIPatchKeys.LEVEL][0], patch_info["level"])
assert_array_equal(meta[WSIPatchKeys.SIZE][0], expected_img.shape[1:])
assert_array_equal(meta[WSIPatchKeys.LOCATION][0], patch_info["location"])
Expand Down Expand Up @@ -397,7 +397,7 @@ def test_read_whole_image_multi_thread(self, file_path, level, expected_shape):
img, meta = reader.get_data(img_obj)
self.assertTupleEqual(img.shape, expected_shape)
self.assertEqual(meta["backend"], self.backend)
self.assertEqual(meta[WSIPatchKeys.PATH], str(os.path.abspath(file_path)))
self.assertEqual(meta[WSIPatchKeys.PATH].lower(), str(os.path.abspath(file_path)).lower())
self.assertEqual(meta[WSIPatchKeys.LEVEL], level)
assert_array_equal(meta[WSIPatchKeys.SIZE], expected_shape[1:])
assert_array_equal(meta[WSIPatchKeys.LOCATION], (0, 0))
Expand All @@ -415,7 +415,7 @@ def test_read_region_multi_thread(self, file_path, kwargs, patch_info, expected_
self.assertTupleEqual(img.shape, expected_img.shape)
self.assertIsNone(assert_array_equal(img, expected_img))
self.assertEqual(meta["backend"], self.backend)
self.assertEqual(meta[WSIPatchKeys.PATH], str(os.path.abspath(file_path)))
self.assertEqual(meta[WSIPatchKeys.PATH].lower(), str(os.path.abspath(file_path)).lower())
self.assertEqual(meta[WSIPatchKeys.LEVEL], patch_info["level"])
assert_array_equal(meta[WSIPatchKeys.SIZE], patch_info["size"])
assert_array_equal(meta[WSIPatchKeys.LOCATION], patch_info["location"])
Expand Down

0 comments on commit f8ad6c6

Please sign in to comment.