summaryrefslogtreecommitdiffstats
path: root/Lib/tkinter/test/widget_tests.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2016-03-09 08:33:51 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2016-03-09 08:33:51 (GMT)
commit42a4366ad51e7a470e59d5694e75e194f18042f3 (patch)
tree8b84cfaab9cb7ae70f8601f39ecf7123945c76a4 /Lib/tkinter/test/widget_tests.py
parent0554d83f0ff7e9da5c021b57820b26a330c09129 (diff)
downloadcpython-42a4366ad51e7a470e59d5694e75e194f18042f3.zip
cpython-42a4366ad51e7a470e59d5694e75e194f18042f3.tar.gz
cpython-42a4366ad51e7a470e59d5694e75e194f18042f3.tar.bz2
Issue #26177: Fixed the keys() method for Canvas and Scrollbar widgets.
Added few missed tests for configure options.
Diffstat (limited to 'Lib/tkinter/test/widget_tests.py')
-rw-r--r--Lib/tkinter/test/widget_tests.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/Lib/tkinter/test/widget_tests.py b/Lib/tkinter/test/widget_tests.py
index 779538d..75a068f 100644
--- a/Lib/tkinter/test/widget_tests.py
+++ b/Lib/tkinter/test/widget_tests.py
@@ -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',