MCPcopy Index your code
hub / github.com/python/cpython / test_focus

Method test_focus

Lib/test/test_ttk/test_widgets.py:1642–1654  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1640 self.assertRaises(tkinter.TclError, self.tv.exists, None)
1641
1642 def test_focus(self):
1643 # nothing is focused right now
1644 self.assertEqual(self.tv.focus(), '')
1645
1646 item1 = self.tv.insert('', 'end')
1647 self.tv.focus(item1)
1648 self.assertEqual(self.tv.focus(), item1)
1649
1650 self.tv.delete(item1)
1651 self.assertEqual(self.tv.focus(), '')
1652
1653 # try focusing inexistent item
1654 self.assertRaises(tkinter.TclError, self.tv.focus, 'hi')
1655
1656 def test_heading(self):
1657 # check a dict is returned

Callers

nothing calls this directly

Calls 5

assertEqualMethod · 0.45
focusMethod · 0.45
insertMethod · 0.45
deleteMethod · 0.45
assertRaisesMethod · 0.45

Tested by

no test coverage detected