summaryrefslogtreecommitdiff
path: root/Lib/tkinter/test/test_ttk/test_functions.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2020-11-22 22:48:52 +0200
committerGitHub <noreply@github.com>2020-11-22 22:48:52 +0200
commitdd844a2916fb3a8f481ec7c732802c13c3375691 (patch)
treed276bed95a59baa88d2ac047972112349f2fd2c8 /Lib/tkinter/test/test_ttk/test_functions.py
parent313467efdc23a1ec8662b77d2001642be598f80a (diff)
downloadcpython-git-dd844a2916fb3a8f481ec7c732802c13c3375691.tar.gz
bpo-42328: Fix tkinter.ttk.Style.map(). (GH-23300)
The function accepts now the representation of the default state as empty sequence (as returned by Style.map()). The structure of the result is now the same on all platform and does not depend on the value of wantobjects.
Diffstat (limited to 'Lib/tkinter/test/test_ttk/test_functions.py')
-rw-r--r--Lib/tkinter/test/test_ttk/test_functions.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/Lib/tkinter/test/test_ttk/test_functions.py b/Lib/tkinter/test/test_ttk/test_functions.py
index f8e69a9f41..5c23d6fecf 100644
--- a/Lib/tkinter/test/test_ttk/test_functions.py
+++ b/Lib/tkinter/test/test_ttk/test_functions.py
@@ -137,6 +137,9 @@ class InternalFunctionsTest(unittest.TestCase):
result = ttk._format_mapdict(opts)
self.assertEqual(result, ('-üñíćódè', 'á vãl'))
+ self.assertEqual(ttk._format_mapdict({'opt': [('value',)]}),
+ ('-opt', '{} value'))
+
# empty states
valid = {'opt': [('', '', 'hi')]}
self.assertEqual(ttk._format_mapdict(valid), ('-opt', '{ } hi'))
@@ -159,10 +162,6 @@ class InternalFunctionsTest(unittest.TestCase):
opts = {'a': None}
self.assertRaises(TypeError, ttk._format_mapdict, opts)
- # items in the value must have size >= 2
- self.assertRaises(IndexError, ttk._format_mapdict,
- {'a': [('invalid', )]})
-
def test_format_elemcreate(self):
self.assertTrue(ttk._format_elemcreate(None), (None, ()))