Back to index

python3.2  3.2.2
Public Member Functions | Private Member Functions
test.test_osx_env.OSXEnvironmentVariableTestCase Class Reference

List of all members.

Public Member Functions

def test_pythonexecutable_sets_sys_executable

Private Member Functions

def _check_sys

Detailed Description

Definition at line 10 of file test_osx_env.py.


Member Function Documentation

def test.test_osx_env.OSXEnvironmentVariableTestCase._check_sys (   self,
  ev,
  cond,
  sv,
  val = sys.executable + 'dummy' 
) [private]

Definition at line 11 of file test_osx_env.py.

00011 
00012     def _check_sys(self, ev, cond, sv, val = sys.executable + 'dummy'):
00013         with EnvironmentVarGuard() as evg:
00014             subpc = [str(sys.executable), '-c',
00015                 'import sys; sys.exit(2 if "%s" %s %s else 3)' % (val, cond, sv)]
00016             # ensure environment variable does not exist
00017             evg.unset(ev)
00018             # test that test on sys.xxx normally fails
00019             rc = subprocess.call(subpc)
00020             self.assertEqual(rc, 3, "expected %s not %s %s" % (ev, cond, sv))
00021             # set environ variable
00022             evg.set(ev, val)
00023             # test that sys.xxx has been influenced by the environ value
00024             rc = subprocess.call(subpc)
00025             self.assertEqual(rc, 2, "expected %s %s %s" % (ev, cond, sv))

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 26 of file test_osx_env.py.

00026 
00027     def test_pythonexecutable_sets_sys_executable(self):
00028         self._check_sys('PYTHONEXECUTABLE', '==', 'sys.executable')

Here is the call graph for this function:


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