Back to index

python3.2  3.2.2
Public Member Functions
tkinter.test.test_tkinter.test_loadtk.TkLoadTest Class Reference

List of all members.

Public Member Functions

def testLoadTk
def testLoadTkFailure

Detailed Description

Definition at line 9 of file test_loadtk.py.


Member Function Documentation

Definition at line 12 of file test_loadtk.py.

00012 
00013     def testLoadTk(self):
00014         tcl = Tcl()
00015         self.assertRaises(TclError,tcl.winfo_geometry)
00016         tcl.loadtk()
00017         self.assertEqual('1x1+0+0', tcl.winfo_geometry())
00018         tcl.destroy()

Here is the call graph for this function:

Definition at line 19 of file test_loadtk.py.

00019 
00020     def testLoadTkFailure(self):
00021         old_display = None
00022         if sys.platform.startswith(('win', 'darwin', 'cygwin')):
00023             # no failure possible on windows?
00024 
00025             # XXX Maybe on tk older than 8.4.13 it would be possible,
00026             # see tkinter.h.
00027             return
00028         with test_support.EnvironmentVarGuard() as env:
00029             if 'DISPLAY' in os.environ:
00030                 del env['DISPLAY']
00031                 # on some platforms, deleting environment variables
00032                 # doesn't actually carry through to the process level
00033                 # because they don't support unsetenv
00034                 # If that's the case, abort.
00035                 with os.popen('echo $DISPLAY') as pipe:
00036                     display = pipe.read().strip()
00037                 if display:
00038                     return
00039 
00040             tcl = Tcl()
00041             self.assertRaises(TclError, tcl.winfo_geometry)
00042             self.assertRaises(TclError, tcl.loadtk)

Here is the call graph for this function:


The documentation for this class was generated from the following file: