Skip to content

Commit

Permalink
Fix tests for the newly added description
Browse files Browse the repository at this point in the history
  • Loading branch information
wkentaro committed Apr 29, 2023
1 parent 637b52d commit 907a871
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion labelme/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -1206,7 +1206,7 @@ def loadLabels(self, shapes):
points = shape["points"]
shape_type = shape["shape_type"]
flags = shape["flags"]
description = shape["description"]
description = shape.get("description", "")
group_id = shape["group_id"]
other_data = shape["other_data"]

Expand Down
9 changes: 6 additions & 3 deletions tests/labelme_tests/widgets_tests/test_label_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,11 @@ def interact():
qtbot.keyClick(widget.edit, QtCore.Qt.Key_Enter) # NOQA

QtCore.QTimer.singleShot(500, interact)
label, flags, group_id = widget.popUp("cat")
label, flags, group_id, description = widget.popUp("cat")
assert label == "person"
assert flags == {}
assert group_id is None
assert description == ""

# popUp()

Expand All @@ -73,10 +74,11 @@ def interact():
qtbot.keyClick(widget.edit, QtCore.Qt.Key_Enter) # NOQA

QtCore.QTimer.singleShot(500, interact)
label, flags, group_id = widget.popUp()
label, flags, group_id, description = widget.popUp()
assert label == "person"
assert flags == {}
assert group_id is None
assert description == ""

# popUp() + key_Up

Expand All @@ -88,7 +90,8 @@ def interact():
qtbot.keyClick(widget.edit, QtCore.Qt.Key_Enter) # NOQA

QtCore.QTimer.singleShot(500, interact)
label, flags, group_id = widget.popUp()
label, flags, group_id, description = widget.popUp()
assert label == "dog"
assert flags == {}
assert group_id is None
assert description == ""

0 comments on commit 907a871

Please sign in to comment.