summaryrefslogtreecommitdiffstats
path: root/Lib/distutils/tests/test_build_ext.py
diff options
context:
space:
mode:
authorTarek Ziadé <ziade.tarek@gmail.com>2009-05-19 16:17:21 (GMT)
committerTarek Ziadé <ziade.tarek@gmail.com>2009-05-19 16:17:21 (GMT)
commit7d7127dd84189bf9325ef3fc5f3c18359fa34f30 (patch)
tree0a2d4d21cee7370a1b7c76f04060171a7daf9154 /Lib/distutils/tests/test_build_ext.py
parentf03c42f0ab4b4fc0705e2717a89af1254820fed3 (diff)
downloadcpython-7d7127dd84189bf9325ef3fc5f3c18359fa34f30.zip
cpython-7d7127dd84189bf9325ef3fc5f3c18359fa34f30.tar.gz
cpython-7d7127dd84189bf9325ef3fc5f3c18359fa34f30.tar.bz2
fixed the 'package' option of build_ext
Diffstat (limited to 'Lib/distutils/tests/test_build_ext.py')
-rw-r--r--Lib/distutils/tests/test_build_ext.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/Lib/distutils/tests/test_build_ext.py b/Lib/distutils/tests/test_build_ext.py
index f1f80be..12b8581 100644
--- a/Lib/distutils/tests/test_build_ext.py
+++ b/Lib/distutils/tests/test_build_ext.py
@@ -336,6 +336,28 @@ class BuildExtTestCase(support.TempdirManager,
so_dir = os.path.dirname(so_file)
self.assertEquals(so_dir, cmd.build_lib)
+ # inplace = 0, cmd.package = 'bar'
+ cmd.package = 'bar'
+ path = cmd.get_ext_fullpath('foo')
+ # checking that the last directory is bar
+ path = os.path.split(path)[0]
+ lastdir = os.path.split(path)[-1]
+ self.assertEquals(lastdir, cmd.package)
+
+ # inplace = 1, cmd.package = 'bar'
+ cmd.inplace = 1
+ other_tmp_dir = os.path.realpath(self.mkdtemp())
+ old_wd = os.getcwd()
+ os.chdir(other_tmp_dir)
+ try:
+ path = cmd.get_ext_fullpath('foo')
+ finally:
+ os.chdir(old_wd)
+ # checking that the last directory is bar
+ path = os.path.split(path)[0]
+ lastdir = os.path.split(path)[-1]
+ self.assertEquals(lastdir, cmd.package)
+
def test_suite():
src = _get_source_filename()
if not os.path.exists(src):