Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Commit

Permalink
writing docstrings to explain the behaviour of the test functions
Browse files Browse the repository at this point in the history
  • Loading branch information
viktorpm committed Feb 16, 2024
1 parent cfccbb8 commit 5cc07cf
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions tests/test_unit/test_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,17 @@ def test_validate_mesh_structure_pairs_no_obj(atlas):
when there is at least one structure in the atlas that doesn't have
a corresponding obj file.
True for: allen_mouse_100um (structure 545 doesn't have an obj file)
False for: admba_3d_e11_5_mouse_16um (it has all pairs)
Expected behaviour:
True for "allen_mouse_10um" (structure 545 doesn't have an obj file): fails
the validation function, raises an error --> no output from this test function
False for "admba_3d_e11_5_mouse_16um" (it has all pairs): no error is
raised by the validation function --> this test function catches it
"""
with pytest.raises(
AssertionError,
match="Structures with ID \[.*\] are in the atlas, but don't have a corresponding mesh file",
match=r"Structures with ID \[.*?\] are in the atlas, but don't have a corresponding mesh file;",
):
validate_mesh_structure_pairs(atlas)

Expand All @@ -93,9 +97,13 @@ def test_validate_mesh_structure_pairs_not_in_atlas(atlas):
"""
Tests if validate_mesh_structure_pairs function raises an error,
when there is at least one orphan obj file (doesn't have a corresponding structure in the atlas)
Expected behaviour:
Currently no atlas fails the validation function this way so the [] is always empty
--> this test function should always raise an error
"""
with pytest.raises(
AssertionError,
match="Structures with IDs \[.*\] have a mesh file, but are not accessible through the atlas",
match=r"Structures with IDs \[.*?\] have a mesh file, but are not accessible through the atlas.",
):
validate_mesh_structure_pairs(atlas)

0 comments on commit 5cc07cf

Please sign in to comment.