1 | n/a | ''' Test idlelib.tree. |
---|
2 | n/a | |
---|
3 | n/a | Coverage: 56% |
---|
4 | n/a | ''' |
---|
5 | n/a | from idlelib import tree |
---|
6 | n/a | from test.support import requires |
---|
7 | n/a | requires('gui') |
---|
8 | n/a | import unittest |
---|
9 | n/a | from tkinter import Tk |
---|
10 | n/a | |
---|
11 | n/a | |
---|
12 | n/a | class TreeTest(unittest.TestCase): |
---|
13 | n/a | |
---|
14 | n/a | @classmethod |
---|
15 | n/a | def setUpClass(cls): |
---|
16 | n/a | cls.root = Tk() |
---|
17 | n/a | cls.root.withdraw() |
---|
18 | n/a | |
---|
19 | n/a | @classmethod |
---|
20 | n/a | def tearDownClass(cls): |
---|
21 | n/a | cls.root.destroy() |
---|
22 | n/a | del cls.root |
---|
23 | n/a | |
---|
24 | n/a | def test_init(self): |
---|
25 | n/a | # Start with code slightly adapted from htest. |
---|
26 | n/a | sc = tree.ScrolledCanvas( |
---|
27 | n/a | self.root, bg="white", highlightthickness=0, takefocus=1) |
---|
28 | n/a | sc.frame.pack(expand=1, fill="both", side='left') |
---|
29 | n/a | item = tree.FileTreeItem(tree.ICONDIR) |
---|
30 | n/a | node = tree.TreeNode(sc.canvas, None, item) |
---|
31 | n/a | node.expand() |
---|
32 | n/a | |
---|
33 | n/a | |
---|
34 | n/a | if __name__ == '__main__': |
---|
35 | n/a | unittest.main(verbosity=2) |
---|