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

Method test_nested

Lib/idlelib/idle_test/test_browser.py:233–253  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

231 "Test that all the nodes in a nested tree are added to the BrowserTree."
232
233 def test_nested(self):
234 queue = deque()
235 actual_names = []
236 # The tree items are processed in breadth first order.
237 # Verify that processing each sublist hits every node and
238 # in the right order.
239 expected_names = ['f0', 'C0(base)',
240 'f1', 'c1', 'F1', 'C1()',
241 'f2', 'C2',
242 'F3']
243 CBT = browser.ChildBrowserTreeItem
244 queue.extend((CBT(f0), CBT(C0)))
245 while queue:
246 cb = queue.popleft()
247 sublist = cb.GetSubList()
248 queue.extend(sublist)
249 self.assertIn(cb.name, cb.GetText())
250 self.assertIn(cb.GetIconName(), ('python', 'folder'))
251 self.assertIs(cb.IsExpandable(), sublist != [])
252 actual_names.append(cb.name)
253 self.assertEqual(actual_names, expected_names)
254
255
256if __name__ == '__main__':

Callers

nothing calls this directly

Calls 9

assertInMethod · 0.80
extendMethod · 0.45
GetSubListMethod · 0.45
GetTextMethod · 0.45
GetIconNameMethod · 0.45
assertIsMethod · 0.45
IsExpandableMethod · 0.45
appendMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected