summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib/idle_test/test_tree.py
diff options
context:
space:
mode:
authorTerry Jan Reedy <tjreedy@udel.edu>2016-06-10 22:19:21 (GMT)
committerTerry Jan Reedy <tjreedy@udel.edu>2016-06-10 22:19:21 (GMT)
commit01e35754fb8a7bcaf88a473db1eb30a14378a49e (patch)
tree66a35e9f29de268b16e00faa5a648cb12a45b743 /Lib/idlelib/idle_test/test_tree.py
parent96881cd6218000380d4a6ce60ff47bb6d785e524 (diff)
downloadcpython-01e35754fb8a7bcaf88a473db1eb30a14378a49e.zip
cpython-01e35754fb8a7bcaf88a473db1eb30a14378a49e.tar.gz
cpython-01e35754fb8a7bcaf88a473db1eb30a14378a49e.tar.bz2
Issue *24750: Switch all scrollbars in IDLE to ttk versions.
Where needed, add minimal tests to cover changes.
Diffstat (limited to 'Lib/idlelib/idle_test/test_tree.py')
-rw-r--r--Lib/idlelib/idle_test/test_tree.py36
1 files changed, 36 insertions, 0 deletions
diff --git a/Lib/idlelib/idle_test/test_tree.py b/Lib/idlelib/idle_test/test_tree.py
new file mode 100644
index 0000000..09ba964
--- /dev/null
+++ b/Lib/idlelib/idle_test/test_tree.py
@@ -0,0 +1,36 @@
+''' Test idlelib.tree.
+
+Coverage: 56%
+'''
+from idlelib import tree
+from test.support import requires
+requires('gui')
+import os
+import unittest
+from tkinter import Tk
+
+
+class TreeTest(unittest.TestCase):
+
+ @classmethod
+ def setUpClass(cls):
+ cls.root = Tk()
+ cls.root.withdraw()
+
+ @classmethod
+ def tearDownClass(cls):
+ cls.root.destroy()
+ del cls.root
+
+ def test_init(self):
+ # Start with code slightly adapted from htest.
+ sc = tree.ScrolledCanvas(
+ self.root, bg="white", highlightthickness=0, takefocus=1)
+ sc.frame.pack(expand=1, fill="both", side='left')
+ item = tree.FileTreeItem(tree.ICONDIR)
+ node = tree.TreeNode(sc.canvas, None, item)
+ node.expand()
+
+
+if __name__ == '__main__':
+ unittest.main(verbosity=2)