Skip to content

Commit

Permalink
write test for save_coords
Browse files Browse the repository at this point in the history
  • Loading branch information
HaleySchuhl committed May 6, 2024
1 parent f42e7ff commit e836c07
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/test_annotate_points.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import cv2
import matplotlib
from plantcv.annotate.classes import Points
from plantcv.plantcv import outputs


def test_points(test_data):
Expand Down Expand Up @@ -150,3 +151,12 @@ def test_points_view_warn(test_data):
drawer_rgb.view(label="new", color='r')

assert str(drawer_rgb.fig) == "Figure(1200x600)"

def test_points_save_coords(test_data):
img = cv2.imread(test_data.small_rgb_img)
totalpoints1 = [(158, 531), (361, 112), (500, 418)]
drawer = Points(img=img)
drawer.import_list(totalpoints1, label="imported")
drawer.save_coords()

assert outputs.observations["default"]["coordinates"]["value"] == [(158, 531), (361, 112), (500, 418)]

0 comments on commit e836c07

Please sign in to comment.