From 2e83526e517ecb61170f061af4cbc213dfa1ef0b Mon Sep 17 00:00:00 2001 From: PJ Eby Date: Mon, 22 Mar 2004 01:12:31 +0000 Subject: Compute command line that should be passed to child setup scripts. Warn user if unsupported options are supplied, and cancel unless 'depends -i' (aka '--ignore-extra-args') was used. --HG-- branch : setuptools extra : convert_revision : svn%3A6015fed2-1504-0410-9fe1-9d1591cc4771/sandbox/trunk/setuptools%4040880 --- setuptools/tests/__init__.py | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) (limited to 'setuptools/tests') diff --git a/setuptools/tests/__init__.py b/setuptools/tests/__init__.py index 913c65bf..66b12646 100644 --- a/setuptools/tests/__init__.py +++ b/setuptools/tests/__init__.py @@ -127,7 +127,10 @@ class DependsTests(TestCase): dist = makeSetup( extra_path='spam', - script_args=['install','--install-lib',path1] + script_args=[ + 'install','--install-lib',path1, '--prefix',path2, + 'build','--compiler=mingw32', + ] ) cmd = dist.get_command_obj('depends') @@ -136,16 +139,13 @@ class DependsTests(TestCase): self.assertEqual(cmd.temp, dist.get_command_obj('build').build_temp) self.assertEqual(cmd.search_path, [path2,path1]+sys.path) - - - - - - - - - - + self.assertEqual(cmd.unsafe_options, + {'install':['--install-lib',path1]} + ) + self.assertEqual(cmd.safe_options, { + 'build':['--compiler','mingw32'], + 'install':['--prefix',os.path.abspath(path2)] + }) @@ -172,6 +172,10 @@ class DistroTests(TestCase): packages=['a', 'a.b', 'a.b.c', 'b', 'c'], py_modules=['b.d','x'], ext_modules = (self.e1, self.e2), + script_args = [ + 'build', '-q', 'build_ext', '-i', + 'install', '--prefix=/usr/lib', '--install-lib','/test' + ], package_dir = {}, ) @@ -199,10 +203,6 @@ class DistroTests(TestCase): - - - - def testIncludeExclude(self): # remove an extension self.dist.exclude(ext_modules=[self.e1]) @@ -271,12 +271,12 @@ class DistroTests(TestCase): self.dist.exclude, package_dir=['q'] ) - - - - - - + def testCmdLineOpts(self): + self.assertEqual(self.dist.get_cmdline_options(), + { 'install':{'prefix':'/usr/lib', 'install-lib':'/test'}, + 'build': {'quiet':None}, 'build_ext':{'inplace':None}, + } + ) -- cgit v1.2.1