summaryrefslogtreecommitdiff
path: root/Lib/idlelib/idle_test/test_window.py
diff options
context:
space:
mode:
authorTerry Jan Reedy <tjreedy@udel.edu>2018-06-20 21:25:59 -0400
committerGitHub <noreply@github.com>2018-06-20 21:25:59 -0400
commita361e89d5ae3daefe9e8b8a7e889cd2ad8c45b77 (patch)
treef213feb31b204946297645de94ca774ca65fd777 /Lib/idlelib/idle_test/test_window.py
parent87a927325e3856621790a39d8718ff24a19510aa (diff)
downloadcpython-git-a361e89d5ae3daefe9e8b8a7e889cd2ad8c45b77.tar.gz
bpo-33906: Rename idlelib.windows as window (#7833)
Match Window on the main menu and remove last plural module name. Change imports, test, and attribute references to match new name.
Diffstat (limited to 'Lib/idlelib/idle_test/test_window.py')
-rw-r--r--Lib/idlelib/idle_test/test_window.py45
1 files changed, 45 insertions, 0 deletions
diff --git a/Lib/idlelib/idle_test/test_window.py b/Lib/idlelib/idle_test/test_window.py
new file mode 100644
index 0000000000..5a2645b9cc
--- /dev/null
+++ b/Lib/idlelib/idle_test/test_window.py
@@ -0,0 +1,45 @@
+"Test window, coverage 47%."
+
+from idlelib import window
+import unittest
+from test.support import requires
+from tkinter import Tk
+
+
+class WindowListTest(unittest.TestCase):
+
+ def test_init(self):
+ wl = window.WindowList()
+ self.assertEqual(wl.dict, {})
+ self.assertEqual(wl.callbacks, [])
+
+ # Further tests need mock Window.
+
+
+class ListedToplevelTest(unittest.TestCase):
+
+ @classmethod
+ def setUpClass(cls):
+ window.registry = set()
+ requires('gui')
+ cls.root = Tk()
+ cls.root.withdraw()
+
+ @classmethod
+ def tearDownClass(cls):
+ window.registry = window.WindowList()
+ cls.root.update_idletasks()
+## for id in cls.root.tk.call('after', 'info'):
+## cls.root.after_cancel(id) # Need for EditorWindow.
+ cls.root.destroy()
+ del cls.root
+
+ def test_init(self):
+
+ win = window.ListedToplevel(self.root)
+ self.assertIn(win, window.registry)
+ self.assertEqual(win.focused_widget, win)
+
+
+if __name__ == '__main__':
+ unittest.main(verbosity=2)