diff options
| author | tarek <devnull@localhost> | 2010-02-22 00:15:39 -0500 |
|---|---|---|
| committer | tarek <devnull@localhost> | 2010-02-22 00:15:39 -0500 |
| commit | 21f60adf286f489f9959647236879db09f7e58ea (patch) | |
| tree | 8654cb2852e485dd492dae31695346bdfbae4641 /src/distutils2/tests/test_extension.py | |
| parent | d3d883d7f595ac5d49009eaff3c00329dbc249b8 (diff) | |
| download | disutils2-21f60adf286f489f9959647236879db09f7e58ea.tar.gz | |
refactoring of the name ... done
Diffstat (limited to 'src/distutils2/tests/test_extension.py')
| -rwxr-xr-x | src/distutils2/tests/test_extension.py | 57 |
1 files changed, 2 insertions, 55 deletions
diff --git a/src/distutils2/tests/test_extension.py b/src/distutils2/tests/test_extension.py index c2cfd07..bd83829 100755 --- a/src/distutils2/tests/test_extension.py +++ b/src/distutils2/tests/test_extension.py @@ -4,65 +4,12 @@ import os import warnings from test.test_support import check_warnings -from distutils2.extension import read_setup_file, Extension +from distutils2.extension import Extension from distutils2.tests.support import capture_warnings class ExtensionTestCase(unittest2.TestCase): - @capture_warnings - def test_read_setup_file(self): - # trying to read a Setup file - # (sample extracted from the PyGame project) - setup = os.path.join(os.path.dirname(__file__), 'Setup.sample') - - exts = read_setup_file(setup) - names = [ext.name for ext in exts] - names.sort() - - # here are the extensions read_setup_file should have created - # out of the file - wanted = ['_arraysurfarray', '_camera', '_numericsndarray', - '_numericsurfarray', 'base', 'bufferproxy', 'cdrom', - 'color', 'constants', 'display', 'draw', 'event', - 'fastevent', 'font', 'gfxdraw', 'image', 'imageext', - 'joystick', 'key', 'mask', 'mixer', 'mixer_music', - 'mouse', 'movie', 'overlay', 'pixelarray', 'pypm', - 'rect', 'rwobject', 'scrap', 'surface', 'surflock', - 'time', 'transform'] - - self.assertEquals(names, wanted) - - def test_extension_init(self): - # the first argument, which is the name, must be a string - self.assertRaises(AssertionError, Extension, 1, []) - ext = Extension('name', []) - self.assertEquals(ext.name, 'name') - - # the second argument, which is the list of files, must - # be a list of strings - self.assertRaises(AssertionError, Extension, 'name', 'file') - self.assertRaises(AssertionError, Extension, 'name', ['file', 1]) - ext = Extension('name', ['file1', 'file2']) - self.assertEquals(ext.sources, ['file1', 'file2']) - - # others arguments have defaults - for attr in ('include_dirs', 'define_macros', 'undef_macros', - 'library_dirs', 'libraries', 'runtime_library_dirs', - 'extra_objects', 'extra_compile_args', 'extra_link_args', - 'export_symbols', 'swig_opts', 'depends'): - self.assertEquals(getattr(ext, attr), []) - - self.assertEquals(ext.language, None) - self.assertEquals(ext.optional, None) - - # if there are unknown keyword options, warn about them - with check_warnings() as w: - warnings.simplefilter('always') - ext = Extension('name', ['file1', 'file2'], chic=True) - - self.assertEquals(len(w.warnings), 1) - self.assertEquals(str(w.warnings[0].message), - "Unknown Extension options: 'chic'") + pass def test_suite(): return unittest2.makeSuite(ExtensionTestCase) |
