def checkParam(self, widget, name, value, *, expected=_sentinel, conv=False, eq=None): widget[name] = value if expected is _sentinel: expected = value if conv: expected = conv(expected) if not self.wantobjects: if isinstance(expected, tuple): expected = tkinter._join(expected) else: expected = str(expected) if eq is None: eq = tcl_obj_eq self.assertEqual2(widget[name], expected, eq=eq) self.assertEqual2(widget.cget(name), expected, eq=eq) # XXX if not isinstance(widget, Scale): t = widget.configure(name) self.assertEqual(len(t), 5) self.assertEqual2(t[4], expected, eq=eq)
def checkParam(self, widget, name, value, *, expected=_sentinel, conv=False, eq=None): widget[name] = value if expected is _sentinel: expected = value if conv: expected = conv(expected) if self._stringify or not self.wantobjects: if isinstance(expected, tuple): expected = tkinter._join(expected) else: expected = str(expected) if eq is None: eq = tcl_obj_eq self.assertEqual2(widget[name], expected, eq=eq) self.assertEqual2(widget.cget(name), expected, eq=eq) # XXX if not isinstance(widget, Scale): t = widget.configure(name) self.assertEqual(len(t), 5) self.assertEqual2(t[4], expected, eq=eq)
def checkParam(self, widget, name, value, *, expected=_sentinel, conv=False, eq=None): widget[name] = value if expected is _sentinel: expected = value if conv: expected = conv(expected) if self._stringify or not self.wantobjects: if isinstance(expected, tuple): expected = tkinter._join(expected) else: expected = str(expected) if eq is None: eq = tcl_obj_eq self.assertEqual2(widget[name], expected, eq=eq) self.assertEqual2(widget.cget(name), expected, eq=eq)
def colorlist(self, *args): if tkinter.TkVersion >= 8.6 and self.wantobjects: return args else: return tkinter._join(args)