mirror of
https://github.com/python/cpython.git
synced 2025-10-31 21:51:50 +00:00
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.
This commit is contained in:
parent
313467efdc
commit
dd844a2916
4 changed files with 111 additions and 28 deletions
|
|
@ -137,6 +137,9 @@ def test_format_mapdict(self):
|
|||
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 @@ def test_format_mapdict(self):
|
|||
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, ()))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue