diff options
author | Tarek Ziadé <ziade.tarek@gmail.com> | 2009-07-03 08:33:28 (GMT) |
---|---|---|
committer | Tarek Ziadé <ziade.tarek@gmail.com> | 2009-07-03 08:33:28 (GMT) |
commit | e10d6dede10faabe48869406100f593584ad111b (patch) | |
tree | 7df7f606b6f6fbe61e1b422b1f80ed5bf60eba97 /Lib/distutils/tests | |
parent | 321e533c4c4cfc32ec6f1fb2c592f8c0e875d6c7 (diff) | |
download | cpython-e10d6dede10faabe48869406100f593584ad111b.zip cpython-e10d6dede10faabe48869406100f593584ad111b.tar.gz cpython-e10d6dede10faabe48869406100f593584ad111b.tar.bz2 |
Merged revisions 73790 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r73790 | tarek.ziade | 2009-07-03 10:22:56 +0200 (Fri, 03 Jul 2009) | 1 line
Fixed #6403 : package path usage for build_ext
........
Diffstat (limited to 'Lib/distutils/tests')
-rw-r--r-- | Lib/distutils/tests/test_build_ext.py | 37 |
1 files changed, 31 insertions, 6 deletions
diff --git a/Lib/distutils/tests/test_build_ext.py b/Lib/distutils/tests/test_build_ext.py index 08e3e1f..6f0e230 100644 --- a/Lib/distutils/tests/test_build_ext.py +++ b/Lib/distutils/tests/test_build_ext.py @@ -337,7 +337,8 @@ class BuildExtTestCase(TempdirManager, self.assertEquals(so_dir, cmd.build_lib) # inplace = 0, cmd.package = 'bar' - cmd.package = 'bar' + build_py = cmd.get_finalized_command('build_py') + build_py.package_dir = {'': 'bar'} path = cmd.get_ext_fullpath('foo') # checking that the last directory is the build_dir path = os.path.split(path)[0] @@ -355,12 +356,14 @@ class BuildExtTestCase(TempdirManager, # checking that the last directory is bar path = os.path.split(path)[0] lastdir = os.path.split(path)[-1] - self.assertEquals(lastdir, cmd.package) + self.assertEquals(lastdir, 'bar') - def test_build_ext_inplace(self): - etree_c = os.path.join(self.tmp_dir, 'lxml.etree.c') - etree_ext = Extension('lxml.etree', [etree_c]) - dist = Distribution({'name': 'lxml', 'ext_modules': [etree_ext]}) + def test_ext_fullpath(self): + # building lxml.etree inplace + #etree_c = os.path.join(self.tmp_dir, 'lxml.etree.c') + #etree_ext = Extension('lxml.etree', [etree_c]) + #dist = Distribution({'name': 'lxml', 'ext_modules': [etree_ext]}) + dist = Distribution() cmd = build_ext(dist) cmd.inplace = 1 cmd.distribution.package_dir = {'': 'src'} @@ -370,6 +373,28 @@ class BuildExtTestCase(TempdirManager, path = cmd.get_ext_fullpath('lxml.etree') self.assertEquals(wanted, path) + # building lxml.etree not inplace + cmd.inplace = 0 + cmd.build_lib = os.path.join(curdir, 'tmpdir') + wanted = os.path.join(curdir, 'tmpdir', 'lxml', 'etree.so') + path = cmd.get_ext_fullpath('lxml.etree') + self.assertEquals(wanted, path) + + # building twisted.runner.portmap not inplace + build_py = cmd.get_finalized_command('build_py') + build_py.package_dir = {} + cmd.distribution.packages = ['twisted', 'twisted.runner.portmap'] + path = cmd.get_ext_fullpath('twisted.runner.portmap') + wanted = os.path.join(curdir, 'tmpdir', 'twisted', 'runner', + 'portmap.so') + self.assertEquals(wanted, path) + + # building twisted.runner.portmap inplace + cmd.inplace = 1 + path = cmd.get_ext_fullpath('twisted.runner.portmap') + wanted = os.path.join(curdir, 'twisted', 'runner', 'portmap.so') + self.assertEquals(wanted, path) + def test_suite(): src = _get_source_filename() if not os.path.exists(src): |