mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
Issue *24750: Switch all scrollbars in IDLE to ttk versions.
Where needed, add minimal tests to cover changes.
This commit is contained in:
parent
96881cd621
commit
01e35754fb
17 changed files with 211 additions and 39 deletions
36
Lib/idlelib/idle_test/test_tree.py
Normal file
36
Lib/idlelib/idle_test/test_tree.py
Normal file
|
@ -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)
|
Loading…
Add table
Add a link
Reference in a new issue