diff options
author | Christian Heimes <christian@cheimes.de> | 2007-12-06 13:15:13 (GMT) |
---|---|---|
committer | Christian Heimes <christian@cheimes.de> | 2007-12-06 13:15:13 (GMT) |
commit | d3fc07a4a076143b9b20f8236e9d1c07bfb818dc (patch) | |
tree | 7977e3d3ecb9088129b06480cf076bb8f81f681c /Lib/distutils/tests | |
parent | d6b20dc54fb46e699fe6358534ee8302ad91d303 (diff) | |
download | cpython-d3fc07a4a076143b9b20f8236e9d1c07bfb818dc.zip cpython-d3fc07a4a076143b9b20f8236e9d1c07bfb818dc.tar.gz cpython-d3fc07a4a076143b9b20f8236e9d1c07bfb818dc.tar.bz2 |
Fixed get_config_h_filename for Windows. Without the patch it can't find the pyconfig.h file inside a build tree.
Added several small unit tests for sysconfig.
Diffstat (limited to 'Lib/distutils/tests')
-rw-r--r-- | Lib/distutils/tests/test_sysconfig.py | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/Lib/distutils/tests/test_sysconfig.py b/Lib/distutils/tests/test_sysconfig.py new file mode 100644 index 0000000..8337b0d --- /dev/null +++ b/Lib/distutils/tests/test_sysconfig.py @@ -0,0 +1,36 @@ +"""Tests for distutils.dist.""" + +from distutils import sysconfig +import os +import sys +import unittest + +from test.test_support import TESTFN + +class SysconfigTestCase(unittest.TestCase): + + def test_get_config_h_filename(self): + config_h = sysconfig.get_config_h_filename() + self.assert_(os.path.isfile(config_h), config_h) + + def test_get_python_lib(self): + lib_dir = sysconfig.get_python_lib() + self.assert_(os.path.isdir(lib_dir), lib_dir) + # test for pythonxx.lib? + + def test_get_python_inc(self): + inc_dir = sysconfig.get_python_inc() + self.assert_(os.path.isdir(inc_dir), inc_dir) + python_h = os.path.join(inc_dir, "Python.h") + self.assert_(os.path.isfile(python_h), python_h) + + def test_get_config_vars(self): + cvars = sysconfig.get_config_vars() + self.assert_(isinstance(cvars, dict)) + self.assert_(cvars) + + +def test_suite(): + suite = unittest.TestSuite() + suite.addTest(unittest.makeSuite(SysconfigTestCase)) + return suite |