MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / test_lasso_set_props

Function test_lasso_set_props

lib/matplotlib/tests/test_widgets.py:1025–1043  ·  view source on GitHub ↗
(ax)

Source from the content-addressed store, hash-verified

1023
1024
1025def test_lasso_set_props(ax):
1026 onselect = mock.Mock(spec=noop, return_value=None)
1027 tool = widgets.Lasso(ax, (100, 100), onselect)
1028 line = tool.line
1029 assert mcolors.same_color(line.get_color(), 'black')
1030 assert line.get_linestyle() == '-'
1031 assert line.get_lw() == 2
1032 tool = widgets.Lasso(ax, (100, 100), onselect, props=dict(
1033 linestyle='-', color='darkblue', alpha=0.2, lw=1))
1034
1035 line = tool.line
1036 assert mcolors.same_color(line.get_color(), 'darkblue')
1037 assert line.get_alpha() == 0.2
1038 assert line.get_lw() == 1
1039 assert line.get_linestyle() == '-'
1040 line.set_color('r')
1041 line.set_alpha(0.3)
1042 assert mcolors.same_color(line.get_color(), 'r')
1043 assert line.get_alpha() == 0.3
1044
1045
1046def test_CheckButtons(ax):

Callers

nothing calls this directly

Calls 5

get_colorMethod · 0.45
get_linestyleMethod · 0.45
get_alphaMethod · 0.45
set_colorMethod · 0.45
set_alphaMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…