Merged revisions 71528 via svnmerge from

svn+ssh://pythondev@svn.python.org/python/trunk

........
  r71528 | tarek.ziade | 2009-04-12 18:45:32 +0200 (Sun, 12 Apr 2009) | 1 line

  added a test for finalize_options
........
This commit is contained in:
Tarek Ziadé 2009-04-12 16:49:20 +00:00
parent fd39b7aa6e
commit bccb0c928f
2 changed files with 16 additions and 0 deletions

View File

@ -12,6 +12,7 @@ this header file lives".
__revision__ = "$Id$" __revision__ = "$Id$"
import sys, os, re import sys, os, re
from distutils.core import Command from distutils.core import Command
from distutils.errors import DistutilsExecError from distutils.errors import DistutilsExecError
from distutils.sysconfig import customize_compiler from distutils.sysconfig import customize_compiler

View File

@ -46,6 +46,21 @@ class ConfigTestCase(support.LoggingSilencer,
match = cmd.search_cpp(pattern='command', body='// xxx') match = cmd.search_cpp(pattern='command', body='// xxx')
self.assertEquals(match, 1) self.assertEquals(match, 1)
def test_finalize_options(self):
# finalize_options does a bit of transformation
# on options
pkg_dir, dist = self.create_dist()
cmd = config(dist)
cmd.include_dirs = 'one%stwo' % os.pathsep
cmd.libraries = 'one'
cmd.library_dirs = 'three%sfour' % os.pathsep
cmd.ensure_finalized()
self.assertEquals(cmd.include_dirs, ['one', 'two'])
self.assertEquals(cmd.libraries, ['one'])
self.assertEquals(cmd.library_dirs, ['three', 'four'])
def test_suite(): def test_suite():
return unittest.makeSuite(ConfigTestCase) return unittest.makeSuite(ConfigTestCase)