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

Method test_tab_identifiers

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

Source from the content-addressed store, hash-verified

1024 self.checkPixelsParam(widget, 'width', '10c', 402, -402, 0)
1025
1026 def test_tab_identifiers(self):
1027 self.nb.forget(0)
1028 self.nb.hide(self.child2)
1029 self.assertRaises(tkinter.TclError, self.nb.tab, self.child1)
1030 self.assertEqual(self.nb.index('end'), 1)
1031 self.nb.add(self.child2)
1032 self.assertEqual(self.nb.index('end'), 1)
1033 self.nb.select(self.child2)
1034
1035 self.assertTrue(self.nb.tab('current'))
1036 self.nb.add(self.child1, text='a')
1037
1038 self.nb.pack()
1039 self.nb.update()
1040 if sys.platform == 'darwin':
1041 tb_idx = "@20,5"
1042 else:
1043 tb_idx = "@5,5"
1044 self.assertEqual(self.nb.tab(tb_idx), self.nb.tab('current'))
1045
1046 for i in range(5, 100, 5):
1047 try:
1048 if self.nb.tab('@%d, 5' % i, text=None) == 'a':
1049 break
1050 except tkinter.TclError:
1051 pass
1052
1053 else:
1054 self.fail("Tab with text 'a' not found")
1055
1056 def test_add_and_hidden(self):
1057 self.assertRaises(tkinter.TclError, self.nb.hide, -1)

Callers

nothing calls this directly

Calls 12

hideMethod · 0.80
assertTrueMethod · 0.80
tabMethod · 0.80
forgetMethod · 0.45
assertRaisesMethod · 0.45
assertEqualMethod · 0.45
indexMethod · 0.45
addMethod · 0.45
selectMethod · 0.45
packMethod · 0.45
updateMethod · 0.45
failMethod · 0.45

Tested by

no test coverage detected