[Python-checkins] r73113 - python/branches/tk_and_idle_maintenance/Lib/lib-tk/test/test_tkinter/test_toplevel.py

guilherme.polo python-checkins at python.org
Mon Jun 1 22:36:32 CEST 2009


Author: guilherme.polo
Date: Mon Jun  1 22:36:32 2009
New Revision: 73113

Log:
A very small set of tests for Tkinter.Toplevel (there isn't much to test here actually).

Added:
   python/branches/tk_and_idle_maintenance/Lib/lib-tk/test/test_tkinter/test_toplevel.py   (contents, props changed)

Added: python/branches/tk_and_idle_maintenance/Lib/lib-tk/test/test_tkinter/test_toplevel.py
==============================================================================
--- (empty file)
+++ python/branches/tk_and_idle_maintenance/Lib/lib-tk/test/test_tkinter/test_toplevel.py	Mon Jun  1 22:36:32 2009
@@ -0,0 +1,27 @@
+import unittest
+import Tkinter
+from test.test_support import requires, run_unittest
+from ttk import setup_master
+
+requires('gui')
+
+class ToplevelTest(unittest.TestCase):
+
+    def setUp(self):
+        self.root = setup_master()
+
+
+    def test_initialization(self):
+        self.root.title('hi')
+        tl = Tkinter.Toplevel(self.root, **{'class_': 'test'})
+        self.assertEqual(tl['class'], 'test')
+        self.assertEqual(tl.title(), 'hi')
+        tl.destroy()
+
+        self.assertRaises(Tkinter.TclError, Tkinter.Toplevel, self.root, a='b')
+
+
+tests_gui = (ToplevelTest, )
+
+if __name__ == "__main__":
+    run_unittest(*tests_gui)


More information about the Python-checkins mailing list