mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Issue #26177: Fixed the keys() method for Canvas and Scrollbar widgets.
Added few missed tests for configure options.
This commit is contained in:
parent
0554d83f0f
commit
42a4366ad5
6 changed files with 183 additions and 138 deletions
|
@ -206,6 +206,33 @@ class AbstractWidgetTest(AbstractTkTest):
|
|||
break
|
||||
|
||||
|
||||
def test_keys(self):
|
||||
widget = self.create()
|
||||
keys = widget.keys()
|
||||
# XXX
|
||||
if not isinstance(widget, Scale):
|
||||
self.assertEqual(sorted(keys), sorted(widget.configure()))
|
||||
for k in keys:
|
||||
widget[k]
|
||||
# Test if OPTIONS contains all keys
|
||||
if test.support.verbose:
|
||||
aliases = {
|
||||
'bd': 'borderwidth',
|
||||
'bg': 'background',
|
||||
'fg': 'foreground',
|
||||
'invcmd': 'invalidcommand',
|
||||
'vcmd': 'validatecommand',
|
||||
}
|
||||
keys = set(keys)
|
||||
expected = set(self.OPTIONS)
|
||||
for k in sorted(keys - expected):
|
||||
if not (k in aliases and
|
||||
aliases[k] in keys and
|
||||
aliases[k] in expected):
|
||||
print('%s.OPTIONS doesn\'t contain "%s"' %
|
||||
(self.__class__.__name__, k))
|
||||
|
||||
|
||||
class StandardOptionsTests:
|
||||
STANDARD_OPTIONS = (
|
||||
'activebackground', 'activeborderwidth', 'activeforeground', 'anchor',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue