(self)
| 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 | |
| 256 | if __name__ == '__main__': |
nothing calls this directly
no test coverage detected