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

Method test_forget

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

Source from the content-addressed store, hash-verified

1082 self.assertEqual(self.nb.index('current'), curr + 1)
1083
1084 def test_forget(self):
1085 self.assertRaises(tkinter.TclError, self.nb.forget, -1)
1086 self.assertRaises(tkinter.TclError, self.nb.forget, 'hi')
1087 self.assertRaises(tkinter.TclError, self.nb.forget, None)
1088
1089 tabs = self.nb.tabs()
1090 child1_index = self.nb.index(self.child1)
1091 self.nb.forget(self.child1)
1092 self.assertNotIn(str(self.child1), self.nb.tabs())
1093 self.assertEqual(len(tabs) - 1, len(self.nb.tabs()))
1094
1095 self.nb.add(self.child1)
1096 self.assertEqual(self.nb.index(self.child1), 1)
1097 self.assertNotEqual(child1_index, self.nb.index(self.child1))
1098
1099 def test_index(self):
1100 self.assertRaises(tkinter.TclError, self.nb.index, -1)

Callers

nothing calls this directly

Calls 9

strFunction · 0.85
tabsMethod · 0.80
assertNotInMethod · 0.80
assertNotEqualMethod · 0.80
assertRaisesMethod · 0.45
indexMethod · 0.45
forgetMethod · 0.45
assertEqualMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected