MCPcopy Index your code
hub / github.com/python/cpython / checkParam

Method checkParam

Lib/test/test_tkinter/widget_tests.py:42–66  ·  view source on GitHub ↗
(self, widget, name, value, *, expected=_sentinel,
                   conv=False, eq=None)

Source from the content-addressed store, hash-verified

40 self.assertEqual(actual, expected, msg)
41
42 def checkParam(self, widget, name, value, *, expected=_sentinel,
43 conv=False, eq=None):
44 widget[name] = value
45 if expected is _sentinel:
46 expected = value
47 if name in self._clipped:
48 if not isinstance(expected, str) and expected < 0:
49 if tk_version >= (8, 7) and name in self._clipped_to_default:
50 expected = self._default_pixels
51 else:
52 expected = 0
53 if conv:
54 expected = conv(expected)
55 if self._stringify or not self.wantobjects:
56 if isinstance(expected, tuple):
57 expected = tkinter._join(expected)
58 else:
59 expected = str(expected)
60 if eq is None:
61 eq = tcl_obj_eq
62 self.assertEqual2(widget[name], expected, eq=eq)
63 self.assertEqual2(widget.cget(name), expected, eq=eq)
64 t = widget.configure(name)
65 self.assertEqual(len(t), 5)
66 self.assertEqual2(t[4], expected, eq=eq)
67
68 def checkInvalidParam(self, widget, name, value, errmsg=None):
69 orig = widget[name]

Callers 15

checkParamsMethod · 0.95
checkFloatParamMethod · 0.95
checkBooleanParamMethod · 0.95
checkCursorParamMethod · 0.95
checkPixelsParamMethod · 0.95
checkImageParamMethod · 0.95
checkVariableParamMethod · 0.95
test_configure_menuMethod · 0.80
test_configure_imageMethod · 0.80
test_configure_menuMethod · 0.80

Calls 7

assertEqual2Method · 0.95
convFunction · 0.85
strFunction · 0.85
_joinMethod · 0.45
cgetMethod · 0.45
configureMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected