ยปCore Development>Code coverage>Lib/idlelib/idle_test/test_tree.py

Python code coverage for Lib/idlelib/idle_test/test_tree.py

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