Skip to content

Commit

Permalink
test color editor for invalid primvar
Browse files Browse the repository at this point in the history
Signed-off-by: Christian López Barrón <[email protected]>
  • Loading branch information
chrizzFTD committed Dec 7, 2024
1 parent 7ebc100 commit afe1c0b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,9 @@ def test_display_color_editor(self):
sphere = UsdGeom.Sphere.Define(stage, "/volume")
color_var = sphere.GetDisplayColorPrimvar()
editor = _attributes._DisplayColorEditor(color_var)
editor._update_value()

with mock.patch("grill.views._attributes.QtWidgets.QColorDialog.getColor", new=lambda *_, **__: QtGui.QColor(255, 255, 0)):
editor._color_launchers["Color"][0].click()

color_var.SetInterpolation(UsdGeom.Tokens.vertex)
editor = _attributes._DisplayColorEditor(color_var)
Expand All @@ -644,6 +646,9 @@ def test_display_color_editor(self):
with self.assertRaises(TypeError): # atm some gprim types are not supported
editor._update_value()

editor = _attributes._DisplayColorEditor(UsdGeom.Primvar())
self.assertEqual(len(editor._value), 1)

def test_stats(self):
# return
empty = stats.StageStats()
Expand Down

0 comments on commit afe1c0b

Please sign in to comment.