Skip to content

Commit

Permalink
tests: add test for repr functionality for QuPathPathAnnotationObjects
Browse files Browse the repository at this point in the history
  • Loading branch information
ap-- committed Aug 19, 2020
1 parent 99a4b89 commit a9e07e4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion paquo/pathobjects.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ def _repr_html_(self):
if hasattr(roi, '_repr_svg_'):
roi_tag = span(rawhtml(repr_svg(roi)), style={"vertical-align": "text-top"})
else:
roi_tag = span(text=roi.wkt)
roi_tag = span(text=roi.wkt) # pragma: no cover

return div(
h4(text=f"{obj_class_name}:", style={"margin-top": "0"}),
Expand Down
4 changes: 4 additions & 0 deletions paquo/tests/test_pathobjects.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ def test_annotation_object():
ao.update_roi(pt)
assert ao.roi == pt

# repr
assert repr(ao)


def test_measurements():
ao = QuPathPathAnnotationObject.from_shapely(
Expand All @@ -127,6 +130,7 @@ def test_measurements():
assert "measurement1" in ao.measurements
assert len(ao.measurements) == 1
assert repr(ao.measurements)
assert str(ao.measurements)

# allow index access (note this depends on order of insertion)
assert ao.measurements[0] == ao.measurements['measurement1']
Expand Down

0 comments on commit a9e07e4

Please sign in to comment.