mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Issue #22226: Added private function _splitdict() in the Tkinter module.
First letter no longer is stripped from the "status" key in the result of Treeview.heading().
This commit is contained in:
parent
c70386ec16
commit
8f0a1d0f28
5 changed files with 112 additions and 93 deletions
|
@ -324,26 +324,13 @@ class InternalFunctionsTest(unittest.TestCase):
|
|||
"-opt {3 2m}")
|
||||
|
||||
|
||||
def test_dict_from_tcltuple(self):
|
||||
fakettuple = ('-a', '{1 2 3}', '-something', 'foo')
|
||||
|
||||
self.assertEqual(ttk._dict_from_tcltuple(fakettuple, False),
|
||||
{'-a': '{1 2 3}', '-something': 'foo'})
|
||||
|
||||
self.assertEqual(ttk._dict_from_tcltuple(fakettuple),
|
||||
{'a': '{1 2 3}', 'something': 'foo'})
|
||||
|
||||
# passing a tuple with a single item should return an empty dict,
|
||||
# since it tries to break the tuple by pairs.
|
||||
self.assertFalse(ttk._dict_from_tcltuple(('single', )))
|
||||
|
||||
sspec = MockStateSpec('a', 'b')
|
||||
self.assertEqual(ttk._dict_from_tcltuple(('-a', (sspec, 'val'))),
|
||||
{'a': [('a', 'b', 'val')]})
|
||||
|
||||
self.assertEqual(ttk._dict_from_tcltuple((MockTclObj('-padding'),
|
||||
[MockTclObj('1'), 2, MockTclObj('3m')])),
|
||||
{'padding': [1, 2, '3m']})
|
||||
def test_tclobj_to_py(self):
|
||||
self.assertEqual(
|
||||
ttk._tclobj_to_py((MockStateSpec('a', 'b'), 'val')),
|
||||
[('a', 'b', 'val')])
|
||||
self.assertEqual(
|
||||
ttk._tclobj_to_py([MockTclObj('1'), 2, MockTclObj('3m')]),
|
||||
[1, 2, '3m'])
|
||||
|
||||
|
||||
def test_list_from_statespec(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue