Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes
distutils.tests.test_sysconfig.SysconfigTestCase Class Reference
Inheritance diagram for distutils.tests.test_sysconfig.SysconfigTestCase:
Inheritance graph
[legend]
Collaboration diagram for distutils.tests.test_sysconfig.SysconfigTestCase:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def setUp
def tearDown
def cleanup_testfn
def test_get_config_h_filename
def test_get_python_lib
def test_get_python_inc
def test_get_config_vars
def test_customize_compiler
def test_parse_makefile_base
def test_parse_makefile_literal_dollar
def test_sysconfig_module

Public Attributes

 makefile
 exes
 old_environ
_PyObject_HEAD_EXTRA Py_ssize_t ob_refcnt
struct _typeobjectob_type

Detailed Description

Definition at line 13 of file test_sysconfig.py.


Member Function Documentation

Definition at line 24 of file test_sysconfig.py.

00024 
00025     def cleanup_testfn(self):
00026         if os.path.isfile(TESTFN):
00027             os.remove(TESTFN)
00028         elif os.path.isdir(TESTFN):
00029             shutil.rmtree(TESTFN)

Here is the call graph for this function:

Here is the caller graph for this function:

Reimplemented from distutils.tests.support.EnvironGuard.

Definition at line 14 of file test_sysconfig.py.

00014 
00015     def setUp(self):
00016         super(SysconfigTestCase, self).setUp()
00017         self.makefile = None

Here is the caller graph for this function:

Reimplemented from distutils.tests.support.EnvironGuard.

Definition at line 18 of file test_sysconfig.py.

00018 
00019     def tearDown(self):
00020         if self.makefile is not None:
00021             os.unlink(self.makefile)
00022         self.cleanup_testfn()
00023         super(SysconfigTestCase, self).tearDown()

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 56 of file test_sysconfig.py.

00056 
00057     def test_customize_compiler(self):
00058 
00059         # not testing if default compiler is not unix
00060         if get_default_compiler() != 'unix':
00061             return
00062 
00063         os.environ['AR'] = 'my_ar'
00064         os.environ['ARFLAGS'] = '-arflags'
00065 
00066         # make sure AR gets caught
00067         class compiler:
00068             compiler_type = 'unix'
00069 
00070             def set_executables(self, **kw):
00071                 self.exes = kw
00072 
00073         comp = compiler()
00074         sysconfig.customize_compiler(comp)
00075         self.assertEqual(comp.exes['archiver'], 'my_ar -arflags')

Here is the call graph for this function:

Definition at line 30 of file test_sysconfig.py.

00030 
00031     def test_get_config_h_filename(self):
00032         config_h = sysconfig.get_config_h_filename()
00033         self.assertTrue(os.path.isfile(config_h), config_h)

Here is the call graph for this function:

Definition at line 51 of file test_sysconfig.py.

00051 
00052     def test_get_config_vars(self):
00053         cvars = sysconfig.get_config_vars()
00054         self.assertTrue(isinstance(cvars, dict))
00055         self.assertTrue(cvars)

Here is the call graph for this function:

Definition at line 42 of file test_sysconfig.py.

00042 
00043     def test_get_python_inc(self):
00044         inc_dir = sysconfig.get_python_inc()
00045         # This is not much of a test.  We make sure Python.h exists
00046         # in the directory returned by get_python_inc() but we don't know
00047         # it is the correct file.
00048         self.assertTrue(os.path.isdir(inc_dir), inc_dir)
00049         python_h = os.path.join(inc_dir, "Python.h")
00050         self.assertTrue(os.path.isfile(python_h), python_h)

Here is the call graph for this function:

Definition at line 34 of file test_sysconfig.py.

00034 
00035     def test_get_python_lib(self):
00036         lib_dir = sysconfig.get_python_lib()
00037         # XXX doesn't work on Linux when Python was never installed before
00038         #self.assertTrue(os.path.isdir(lib_dir), lib_dir)
00039         # test for pythonxx.lib?
00040         self.assertNotEqual(sysconfig.get_python_lib(),
00041                             sysconfig.get_python_lib(prefix=TESTFN))

Here is the call graph for this function:

Definition at line 76 of file test_sysconfig.py.

00076 
00077     def test_parse_makefile_base(self):
00078         self.makefile = TESTFN
00079         fd = open(self.makefile, 'w')
00080         try:
00081             fd.write(r"CONFIG_ARGS=  '--arg1=optarg1' 'ENV=LIB'" '\n')
00082             fd.write('VAR=$OTHER\nOTHER=foo')
00083         finally:
00084             fd.close()
00085         d = sysconfig.parse_makefile(self.makefile)
00086         self.assertEqual(d, {'CONFIG_ARGS': "'--arg1=optarg1' 'ENV=LIB'",
00087                              'OTHER': 'foo'})

Here is the call graph for this function:

Definition at line 88 of file test_sysconfig.py.

00088 
00089     def test_parse_makefile_literal_dollar(self):
00090         self.makefile = TESTFN
00091         fd = open(self.makefile, 'w')
00092         try:
00093             fd.write(r"CONFIG_ARGS=  '--arg1=optarg1' 'ENV=\$$LIB'" '\n')
00094             fd.write('VAR=$OTHER\nOTHER=foo')
00095         finally:
00096             fd.close()
00097         d = sysconfig.parse_makefile(self.makefile)
00098         self.assertEqual(d, {'CONFIG_ARGS': r"'--arg1=optarg1' 'ENV=\$LIB'",
00099                              'OTHER': 'foo'})
00100 

Here is the call graph for this function:

Definition at line 101 of file test_sysconfig.py.

00101 
00102     def test_sysconfig_module(self):
00103         import sysconfig as global_sysconfig
00104         self.assertEqual(global_sysconfig.get_config_var('CFLAGS'), sysconfig.get_config_var('CFLAGS'))
00105         self.assertEqual(global_sysconfig.get_config_var('LDFLAGS'), sysconfig.get_config_var('LDFLAGS'))
00106         self.assertEqual(global_sysconfig.get_config_var('LDSHARED'),sysconfig.get_config_var('LDSHARED'))
00107         self.assertEqual(global_sysconfig.get_config_var('CC'), sysconfig.get_config_var('CC'))
00108 
00109 

Here is the call graph for this function:


Member Data Documentation

Definition at line 70 of file test_sysconfig.py.

Definition at line 16 of file test_sysconfig.py.

Definition at line 107 of file object.h.

struct _typeobject* _object::ob_type [inherited]

Definition at line 108 of file object.h.

Definition at line 125 of file support.py.


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