Skip to content

Commit e138400

Browse files
committed
Add a test for setting properties on LassoSelector
There are already a few for the other Selectors.
1 parent 1699c02 commit e138400

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

lib/matplotlib/tests/test_widgets.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -987,6 +987,19 @@ def test_lasso_selector(ax, kwargs):
987987
onselect.assert_called_once_with([(100, 100), (125, 125), (150, 150)])
988988

989989

990+
def test_lasso_selector_set_props(ax):
991+
onselect = mock.Mock(spec=noop, return_value=None)
992+
993+
tool = widgets.LassoSelector(ax, onselect, props=dict(color='b', alpha=0.2))
994+
995+
artist = tool._selection_artist
996+
assert mcolors.same_color(artist.get_color(), 'b')
997+
assert artist.get_alpha() == 0.2
998+
tool.set_props(color='r', alpha=0.3)
999+
assert mcolors.same_color(artist.get_color(), 'r')
1000+
assert artist.get_alpha() == 0.3
1001+
1002+
9901003
def test_CheckButtons(ax):
9911004
check = widgets.CheckButtons(ax, ('a', 'b', 'c'), (True, False, True))
9921005
assert check.get_status() == [True, False, True]

0 commit comments

Comments
 (0)