Skip to content

Commit 8b4a937

Browse files
committed
check full inspector messages
1 parent b876f1a commit 8b4a937

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

tests/unit_tests/test_images.py

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from pynwb.base import Images, ImageReferences
44
from pynwb.image import GrayscaleImage
55

6+
from nwbinspector import InspectorMessage, Importance
67
from nwbinspector.checks.images import check_order_of_images_unique, check_order_of_images_len
78

89

@@ -12,7 +13,14 @@ def test_check_order_of_images_unique():
1213
img_refs = ImageReferences(name="order_of_images", data=imgs + [imgs[0]])
1314
images = Images(name="my_images", images=imgs, order_of_images=img_refs)
1415

15-
assert check_order_of_images_unique(images).message == "order_of_images should have unique values."
16+
assert check_order_of_images_unique(images) == InspectorMessage(
17+
message="order_of_images should have unique values.",
18+
importance=Importance.BEST_PRACTICE_VIOLATION,
19+
check_function_name="check_order_of_images_unique",
20+
object_type="Images",
21+
object_name="my_images",
22+
location="/",
23+
)
1624

1725

1826
def test_pass_check_order_of_images_unique():
@@ -30,9 +38,13 @@ def test_check_order_of_images_len():
3038
img_refs = ImageReferences(name="order_of_images", data=imgs + [imgs[0]])
3139
images = Images(name="my_images", images=imgs, order_of_images=img_refs)
3240

33-
assert (
34-
check_order_of_images_len(images).message
35-
== f"Length of order_of_images (6) does not match the number of images (5)."
41+
assert check_order_of_images_len(images) == InspectorMessage(
42+
message=f"Length of order_of_images (6) does not match the number of images (5).",
43+
importance=Importance.BEST_PRACTICE_VIOLATION,
44+
check_function_name="check_order_of_images_len",
45+
object_type="Images",
46+
object_name="my_images",
47+
location="/",
3648
)
3749

3850

0 commit comments

Comments
 (0)