mirror of
https://github.com/python/cpython.git
synced 2026-01-06 15:32:22 +00:00
Merged revisions 86596 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r86596 | ezio.melotti | 2010-11-20 21:04:17 +0200 (Sat, 20 Nov 2010) | 1 line #9424: Replace deprecated assert* methods in the Python test suite. ........
This commit is contained in:
parent
b65b4937e2
commit
19f2aeba67
164 changed files with 2281 additions and 2279 deletions
|
|
@ -113,7 +113,7 @@ def test_tarfile_vs_tar(self):
|
|||
|
||||
self.assertTrue(os.path.exists(tarball2))
|
||||
# let's compare both tarballs
|
||||
self.assertEquals(self._tarinfo(tarball), self._tarinfo(tarball2))
|
||||
self.assertEqual(self._tarinfo(tarball), self._tarinfo(tarball2))
|
||||
|
||||
# trying an uncompressed one
|
||||
base_name = os.path.join(tmpdir2, 'archive')
|
||||
|
|
@ -153,7 +153,7 @@ def test_compress_deprecated(self):
|
|||
os.chdir(old_dir)
|
||||
tarball = base_name + '.tar.Z'
|
||||
self.assertTrue(os.path.exists(tarball))
|
||||
self.assertEquals(len(w.warnings), 1)
|
||||
self.assertEqual(len(w.warnings), 1)
|
||||
|
||||
# same test with dry_run
|
||||
os.remove(tarball)
|
||||
|
|
@ -167,7 +167,7 @@ def test_compress_deprecated(self):
|
|||
finally:
|
||||
os.chdir(old_dir)
|
||||
self.assertTrue(not os.path.exists(tarball))
|
||||
self.assertEquals(len(w.warnings), 1)
|
||||
self.assertEqual(len(w.warnings), 1)
|
||||
|
||||
@unittest.skipUnless(ZIP_SUPPORT, 'Need zip support to run')
|
||||
def test_make_zipfile(self):
|
||||
|
|
@ -184,9 +184,9 @@ def test_make_zipfile(self):
|
|||
tarball = base_name + '.zip'
|
||||
|
||||
def test_check_archive_formats(self):
|
||||
self.assertEquals(check_archive_formats(['gztar', 'xxx', 'zip']),
|
||||
'xxx')
|
||||
self.assertEquals(check_archive_formats(['gztar', 'zip']), None)
|
||||
self.assertEqual(check_archive_formats(['gztar', 'xxx', 'zip']),
|
||||
'xxx')
|
||||
self.assertEqual(check_archive_formats(['gztar', 'zip']), None)
|
||||
|
||||
def test_make_archive(self):
|
||||
tmpdir = self.mkdtemp()
|
||||
|
|
@ -203,7 +203,7 @@ def _breaks(*args, **kw):
|
|||
make_archive('xxx', 'xxx', root_dir=self.mkdtemp())
|
||||
except:
|
||||
pass
|
||||
self.assertEquals(os.getcwd(), current_dir)
|
||||
self.assertEqual(os.getcwd(), current_dir)
|
||||
finally:
|
||||
del ARCHIVE_FORMATS['xxx']
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ def test_formats(self):
|
|||
cmd = bdist(dist)
|
||||
cmd.formats = ['msi']
|
||||
cmd.ensure_finalized()
|
||||
self.assertEquals(cmd.formats, ['msi'])
|
||||
self.assertEqual(cmd.formats, ['msi'])
|
||||
|
||||
# what format bdist offers ?
|
||||
# XXX an explicit list in bdist is
|
||||
|
|
@ -34,7 +34,7 @@ def test_formats(self):
|
|||
formats.sort()
|
||||
founded = list(cmd.format_command.keys())
|
||||
founded.sort()
|
||||
self.assertEquals(founded, formats)
|
||||
self.assertEqual(founded, formats)
|
||||
|
||||
def test_suite():
|
||||
return unittest.makeSuite(BuildTestCase)
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ def test_simple_built(self):
|
|||
base = base.replace(':', '-')
|
||||
|
||||
wanted = ['%s.zip' % base]
|
||||
self.assertEquals(dist_created, wanted)
|
||||
self.assertEqual(dist_created, wanted)
|
||||
|
||||
# now let's check what we have in the zip file
|
||||
# XXX to be done
|
||||
|
|
|
|||
|
|
@ -55,14 +55,14 @@ def test_get_source_files(self):
|
|||
self.assertRaises(DistutilsSetupError, cmd.get_source_files)
|
||||
|
||||
cmd.libraries = [('name', {'sources': ['a', 'b']})]
|
||||
self.assertEquals(cmd.get_source_files(), ['a', 'b'])
|
||||
self.assertEqual(cmd.get_source_files(), ['a', 'b'])
|
||||
|
||||
cmd.libraries = [('name', {'sources': ('a', 'b')})]
|
||||
self.assertEquals(cmd.get_source_files(), ['a', 'b'])
|
||||
self.assertEqual(cmd.get_source_files(), ['a', 'b'])
|
||||
|
||||
cmd.libraries = [('name', {'sources': ('a', 'b')}),
|
||||
('name2', {'sources': ['c', 'd']})]
|
||||
self.assertEquals(cmd.get_source_files(), ['a', 'b', 'c', 'd'])
|
||||
self.assertEqual(cmd.get_source_files(), ['a', 'b', 'c', 'd'])
|
||||
|
||||
def test_build_libraries(self):
|
||||
|
||||
|
|
@ -91,11 +91,11 @@ def test_finalize_options(self):
|
|||
|
||||
cmd.include_dirs = 'one-dir'
|
||||
cmd.finalize_options()
|
||||
self.assertEquals(cmd.include_dirs, ['one-dir'])
|
||||
self.assertEqual(cmd.include_dirs, ['one-dir'])
|
||||
|
||||
cmd.include_dirs = None
|
||||
cmd.finalize_options()
|
||||
self.assertEquals(cmd.include_dirs, [])
|
||||
self.assertEqual(cmd.include_dirs, [])
|
||||
|
||||
cmd.distribution.libraries = 'WONTWORK'
|
||||
self.assertRaises(DistutilsSetupError, cmd.finalize_options)
|
||||
|
|
|
|||
|
|
@ -96,11 +96,11 @@ def test_build_ext(self):
|
|||
for attr in ('error', 'foo', 'new', 'roj'):
|
||||
self.assertTrue(hasattr(xx, attr))
|
||||
|
||||
self.assertEquals(xx.foo(2, 5), 7)
|
||||
self.assertEquals(xx.foo(13,15), 28)
|
||||
self.assertEquals(xx.new().demo(), None)
|
||||
self.assertEqual(xx.foo(2, 5), 7)
|
||||
self.assertEqual(xx.foo(13,15), 28)
|
||||
self.assertEqual(xx.new().demo(), None)
|
||||
doc = 'This is a template module just for instruction.'
|
||||
self.assertEquals(xx.__doc__, doc)
|
||||
self.assertEqual(xx.__doc__, doc)
|
||||
self.assertTrue(isinstance(xx.Null(), xx.Null))
|
||||
self.assertTrue(isinstance(xx.Str(), xx.Str))
|
||||
|
||||
|
|
@ -206,7 +206,7 @@ def test_finalize_options(self):
|
|||
cmd = build_ext(dist)
|
||||
cmd.libraries = 'my_lib'
|
||||
cmd.finalize_options()
|
||||
self.assertEquals(cmd.libraries, ['my_lib'])
|
||||
self.assertEqual(cmd.libraries, ['my_lib'])
|
||||
|
||||
# make sure cmd.library_dirs is turned into a list
|
||||
# if it's a string
|
||||
|
|
@ -220,7 +220,7 @@ def test_finalize_options(self):
|
|||
cmd = build_ext(dist)
|
||||
cmd.rpath = os.pathsep.join(['one', 'two'])
|
||||
cmd.finalize_options()
|
||||
self.assertEquals(cmd.rpath, ['one', 'two'])
|
||||
self.assertEqual(cmd.rpath, ['one', 'two'])
|
||||
|
||||
# XXX more tests to perform for win32
|
||||
|
||||
|
|
@ -229,25 +229,25 @@ def test_finalize_options(self):
|
|||
cmd = build_ext(dist)
|
||||
cmd.define = 'one,two'
|
||||
cmd.finalize_options()
|
||||
self.assertEquals(cmd.define, [('one', '1'), ('two', '1')])
|
||||
self.assertEqual(cmd.define, [('one', '1'), ('two', '1')])
|
||||
|
||||
# make sure undef is turned into a list of
|
||||
# strings if they are ','-separated strings
|
||||
cmd = build_ext(dist)
|
||||
cmd.undef = 'one,two'
|
||||
cmd.finalize_options()
|
||||
self.assertEquals(cmd.undef, ['one', 'two'])
|
||||
self.assertEqual(cmd.undef, ['one', 'two'])
|
||||
|
||||
# make sure swig_opts is turned into a list
|
||||
cmd = build_ext(dist)
|
||||
cmd.swig_opts = None
|
||||
cmd.finalize_options()
|
||||
self.assertEquals(cmd.swig_opts, [])
|
||||
self.assertEqual(cmd.swig_opts, [])
|
||||
|
||||
cmd = build_ext(dist)
|
||||
cmd.swig_opts = '1 2'
|
||||
cmd.finalize_options()
|
||||
self.assertEquals(cmd.swig_opts, ['1', '2'])
|
||||
self.assertEqual(cmd.swig_opts, ['1', '2'])
|
||||
|
||||
def test_check_extensions_list(self):
|
||||
dist = Distribution()
|
||||
|
|
@ -283,7 +283,7 @@ def test_check_extensions_list(self):
|
|||
# check_extensions_list adds in ext the values passed
|
||||
# when they are in ('include_dirs', 'library_dirs', 'libraries'
|
||||
# 'extra_objects', 'extra_compile_args', 'extra_link_args')
|
||||
self.assertEquals(ext.libraries, 'foo')
|
||||
self.assertEqual(ext.libraries, 'foo')
|
||||
self.assertTrue(not hasattr(ext, 'some'))
|
||||
|
||||
# 'macros' element of build info dict must be 1- or 2-tuple
|
||||
|
|
@ -293,15 +293,15 @@ def test_check_extensions_list(self):
|
|||
|
||||
exts[0][1]['macros'] = [('1', '2'), ('3',)]
|
||||
cmd.check_extensions_list(exts)
|
||||
self.assertEquals(exts[0].undef_macros, ['3'])
|
||||
self.assertEquals(exts[0].define_macros, [('1', '2')])
|
||||
self.assertEqual(exts[0].undef_macros, ['3'])
|
||||
self.assertEqual(exts[0].define_macros, [('1', '2')])
|
||||
|
||||
def test_get_source_files(self):
|
||||
modules = [Extension('foo', ['xxx'], optional=False)]
|
||||
dist = Distribution({'name': 'xx', 'ext_modules': modules})
|
||||
cmd = build_ext(dist)
|
||||
cmd.ensure_finalized()
|
||||
self.assertEquals(cmd.get_source_files(), ['xxx'])
|
||||
self.assertEqual(cmd.get_source_files(), ['xxx'])
|
||||
|
||||
def test_compiler_option(self):
|
||||
# cmd.compiler is an option and
|
||||
|
|
@ -312,7 +312,7 @@ def test_compiler_option(self):
|
|||
cmd.compiler = 'unix'
|
||||
cmd.ensure_finalized()
|
||||
cmd.run()
|
||||
self.assertEquals(cmd.compiler, 'unix')
|
||||
self.assertEqual(cmd.compiler, 'unix')
|
||||
|
||||
def test_get_outputs(self):
|
||||
tmp_dir = self.mkdtemp()
|
||||
|
|
@ -324,7 +324,7 @@ def test_get_outputs(self):
|
|||
cmd = build_ext(dist)
|
||||
self._fixup_command(cmd)
|
||||
cmd.ensure_finalized()
|
||||
self.assertEquals(len(cmd.get_outputs()), 1)
|
||||
self.assertEqual(len(cmd.get_outputs()), 1)
|
||||
|
||||
if os.name == "nt":
|
||||
cmd.debug = sys.executable.endswith("_d.exe")
|
||||
|
|
@ -344,20 +344,20 @@ def test_get_outputs(self):
|
|||
finally:
|
||||
os.chdir(old_wd)
|
||||
self.assertTrue(os.path.exists(so_file))
|
||||
self.assertEquals(os.path.splitext(so_file)[-1],
|
||||
sysconfig.get_config_var('SO'))
|
||||
self.assertEqual(os.path.splitext(so_file)[-1],
|
||||
sysconfig.get_config_var('SO'))
|
||||
so_dir = os.path.dirname(so_file)
|
||||
self.assertEquals(so_dir, other_tmp_dir)
|
||||
self.assertEqual(so_dir, other_tmp_dir)
|
||||
|
||||
cmd.inplace = 0
|
||||
cmd.compiler = None
|
||||
cmd.run()
|
||||
so_file = cmd.get_outputs()[0]
|
||||
self.assertTrue(os.path.exists(so_file))
|
||||
self.assertEquals(os.path.splitext(so_file)[-1],
|
||||
sysconfig.get_config_var('SO'))
|
||||
self.assertEqual(os.path.splitext(so_file)[-1],
|
||||
sysconfig.get_config_var('SO'))
|
||||
so_dir = os.path.dirname(so_file)
|
||||
self.assertEquals(so_dir, cmd.build_lib)
|
||||
self.assertEqual(so_dir, cmd.build_lib)
|
||||
|
||||
# inplace = 0, cmd.package = 'bar'
|
||||
build_py = cmd.get_finalized_command('build_py')
|
||||
|
|
@ -365,7 +365,7 @@ def test_get_outputs(self):
|
|||
path = cmd.get_ext_fullpath('foo')
|
||||
# checking that the last directory is the build_dir
|
||||
path = os.path.split(path)[0]
|
||||
self.assertEquals(path, cmd.build_lib)
|
||||
self.assertEqual(path, cmd.build_lib)
|
||||
|
||||
# inplace = 1, cmd.package = 'bar'
|
||||
cmd.inplace = 1
|
||||
|
|
@ -379,7 +379,7 @@ def test_get_outputs(self):
|
|||
# checking that the last directory is bar
|
||||
path = os.path.split(path)[0]
|
||||
lastdir = os.path.split(path)[-1]
|
||||
self.assertEquals(lastdir, 'bar')
|
||||
self.assertEqual(lastdir, 'bar')
|
||||
|
||||
def test_ext_fullpath(self):
|
||||
ext = sysconfig.get_config_vars()['SO']
|
||||
|
|
@ -395,14 +395,14 @@ def test_ext_fullpath(self):
|
|||
curdir = os.getcwd()
|
||||
wanted = os.path.join(curdir, 'src', 'lxml', 'etree' + ext)
|
||||
path = cmd.get_ext_fullpath('lxml.etree')
|
||||
self.assertEquals(wanted, path)
|
||||
self.assertEqual(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' + ext)
|
||||
path = cmd.get_ext_fullpath('lxml.etree')
|
||||
self.assertEquals(wanted, path)
|
||||
self.assertEqual(wanted, path)
|
||||
|
||||
# building twisted.runner.portmap not inplace
|
||||
build_py = cmd.get_finalized_command('build_py')
|
||||
|
|
@ -411,13 +411,13 @@ def test_ext_fullpath(self):
|
|||
path = cmd.get_ext_fullpath('twisted.runner.portmap')
|
||||
wanted = os.path.join(curdir, 'tmpdir', 'twisted', 'runner',
|
||||
'portmap' + ext)
|
||||
self.assertEquals(wanted, path)
|
||||
self.assertEqual(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' + ext)
|
||||
self.assertEquals(wanted, path)
|
||||
self.assertEqual(wanted, path)
|
||||
|
||||
def test_suite():
|
||||
src = _get_source_filename()
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ def test_check_metadata(self):
|
|||
# by default, check is checking the metadata
|
||||
# should have some warnings
|
||||
cmd = self._run()
|
||||
self.assertEquals(cmd._warnings, 2)
|
||||
self.assertEqual(cmd._warnings, 2)
|
||||
|
||||
# now let's add the required fields
|
||||
# and run it again, to make sure we don't get
|
||||
|
|
@ -35,7 +35,7 @@ def test_check_metadata(self):
|
|||
'author_email': 'xxx',
|
||||
'name': 'xxx', 'version': 'xxx'}
|
||||
cmd = self._run(metadata)
|
||||
self.assertEquals(cmd._warnings, 0)
|
||||
self.assertEqual(cmd._warnings, 0)
|
||||
|
||||
# now with the strict mode, we should
|
||||
# get an error if there are missing metadata
|
||||
|
|
@ -43,7 +43,7 @@ def test_check_metadata(self):
|
|||
|
||||
# and of course, no error when all metadata are present
|
||||
cmd = self._run(metadata, strict=1)
|
||||
self.assertEquals(cmd._warnings, 0)
|
||||
self.assertEqual(cmd._warnings, 0)
|
||||
|
||||
def test_check_document(self):
|
||||
if not HAS_DOCUTILS: # won't test without docutils
|
||||
|
|
@ -54,12 +54,12 @@ def test_check_document(self):
|
|||
# let's see if it detects broken rest
|
||||
broken_rest = 'title\n===\n\ntest'
|
||||
msgs = cmd._check_rst_data(broken_rest)
|
||||
self.assertEquals(len(msgs), 1)
|
||||
self.assertEqual(len(msgs), 1)
|
||||
|
||||
# and non-broken rest
|
||||
rest = 'title\n=====\n\ntest'
|
||||
msgs = cmd._check_rst_data(rest)
|
||||
self.assertEquals(len(msgs), 0)
|
||||
self.assertEqual(len(msgs), 0)
|
||||
|
||||
def test_check_restructuredtext(self):
|
||||
if not HAS_DOCUTILS: # won't test without docutils
|
||||
|
|
@ -69,7 +69,7 @@ def test_check_restructuredtext(self):
|
|||
pkg_info, dist = self.create_dist(long_description=broken_rest)
|
||||
cmd = check(dist)
|
||||
cmd.check_restructuredtext()
|
||||
self.assertEquals(cmd._warnings, 1)
|
||||
self.assertEqual(cmd._warnings, 1)
|
||||
|
||||
# let's see if we have an error with strict=1
|
||||
metadata = {'url': 'xxx', 'author': 'xxx',
|
||||
|
|
@ -82,7 +82,7 @@ def test_check_restructuredtext(self):
|
|||
# and non-broken rest
|
||||
metadata['long_description'] = 'title\n=====\n\ntest'
|
||||
cmd = self._run(metadata, strict=1, restructuredtext=1)
|
||||
self.assertEquals(cmd._warnings, 0)
|
||||
self.assertEqual(cmd._warnings, 0)
|
||||
|
||||
def test_check_all(self):
|
||||
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ def test_make_file(self):
|
|||
|
||||
# making sure execute gets called properly
|
||||
def _execute(func, args, exec_msg, level):
|
||||
self.assertEquals(exec_msg, 'generating out from in')
|
||||
self.assertEqual(exec_msg, 'generating out from in')
|
||||
cmd.force = True
|
||||
cmd.execute = _execute
|
||||
cmd.make_file(infiles='in', outfile='out', func='func', args=())
|
||||
|
|
@ -63,7 +63,7 @@ def _announce(msg, level):
|
|||
|
||||
wanted = ["command options for 'MyCmd':", ' option1 = 1',
|
||||
' option2 = 1']
|
||||
self.assertEquals(msgs, wanted)
|
||||
self.assertEqual(msgs, wanted)
|
||||
|
||||
def test_ensure_string(self):
|
||||
cmd = self.cmd
|
||||
|
|
@ -81,7 +81,7 @@ def test_ensure_string_list(self):
|
|||
cmd = self.cmd
|
||||
cmd.option1 = 'ok,dok'
|
||||
cmd.ensure_string_list('option1')
|
||||
self.assertEquals(cmd.option1, ['ok', 'dok'])
|
||||
self.assertEqual(cmd.option1, ['ok', 'dok'])
|
||||
|
||||
cmd.option2 = ['xxx', 'www']
|
||||
cmd.ensure_string_list('option2')
|
||||
|
|
@ -109,14 +109,14 @@ def test_debug_print(self):
|
|||
with captured_stdout() as stdout:
|
||||
cmd.debug_print('xxx')
|
||||
stdout.seek(0)
|
||||
self.assertEquals(stdout.read(), '')
|
||||
self.assertEqual(stdout.read(), '')
|
||||
|
||||
debug.DEBUG = True
|
||||
try:
|
||||
with captured_stdout() as stdout:
|
||||
cmd.debug_print('xxx')
|
||||
stdout.seek(0)
|
||||
self.assertEquals(stdout.read(), 'xxx\n')
|
||||
self.assertEqual(stdout.read(), 'xxx\n')
|
||||
finally:
|
||||
debug.DEBUG = False
|
||||
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ def test_server_registration(self):
|
|||
waited = [('password', 'secret'), ('realm', 'pypi'),
|
||||
('repository', 'http://pypi.python.org/pypi'),
|
||||
('server', 'server1'), ('username', 'me')]
|
||||
self.assertEquals(config, waited)
|
||||
self.assertEqual(config, waited)
|
||||
|
||||
# old format
|
||||
self.write_file(self.rc, PYPIRC_OLD)
|
||||
|
|
@ -97,7 +97,7 @@ def test_server_registration(self):
|
|||
waited = [('password', 'secret'), ('realm', 'pypi'),
|
||||
('repository', 'http://pypi.python.org/pypi'),
|
||||
('server', 'server-login'), ('username', 'tarek')]
|
||||
self.assertEquals(config, waited)
|
||||
self.assertEqual(config, waited)
|
||||
|
||||
def test_server_empty_registration(self):
|
||||
cmd = self._cmd(self.dist)
|
||||
|
|
@ -108,7 +108,7 @@ def test_server_empty_registration(self):
|
|||
f = open(rc)
|
||||
try:
|
||||
content = f.read()
|
||||
self.assertEquals(content, WANTED)
|
||||
self.assertEqual(content, WANTED)
|
||||
finally:
|
||||
f.close()
|
||||
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ def test_dump_file(self):
|
|||
f.close()
|
||||
|
||||
dump_file(this_file, 'I am the header')
|
||||
self.assertEquals(len(self._logs), numlines+1)
|
||||
self.assertEqual(len(self._logs), numlines+1)
|
||||
|
||||
def test_search_cpp(self):
|
||||
if sys.platform == 'win32':
|
||||
|
|
@ -44,10 +44,10 @@ def test_search_cpp(self):
|
|||
|
||||
# simple pattern searches
|
||||
match = cmd.search_cpp(pattern='xxx', body='// xxx')
|
||||
self.assertEquals(match, 0)
|
||||
self.assertEqual(match, 0)
|
||||
|
||||
match = cmd.search_cpp(pattern='_configtest', body='// xxx')
|
||||
self.assertEquals(match, 1)
|
||||
self.assertEqual(match, 1)
|
||||
|
||||
def test_finalize_options(self):
|
||||
# finalize_options does a bit of transformation
|
||||
|
|
@ -59,9 +59,9 @@ def test_finalize_options(self):
|
|||
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'])
|
||||
self.assertEqual(cmd.include_dirs, ['one', 'two'])
|
||||
self.assertEqual(cmd.libraries, ['one'])
|
||||
self.assertEqual(cmd.library_dirs, ['three', 'four'])
|
||||
|
||||
def test_clean(self):
|
||||
# _clean removes files
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ def test_debug_mode(self):
|
|||
with captured_stdout() as stdout:
|
||||
distutils.core.setup(name='bar')
|
||||
stdout.seek(0)
|
||||
self.assertEquals(stdout.read(), 'bar\n')
|
||||
self.assertEqual(stdout.read(), 'bar\n')
|
||||
|
||||
distutils.core.DEBUG = True
|
||||
try:
|
||||
|
|
@ -99,7 +99,7 @@ def test_debug_mode(self):
|
|||
distutils.core.DEBUG = False
|
||||
stdout.seek(0)
|
||||
wanted = "options (after parsing config files):\n"
|
||||
self.assertEquals(stdout.readlines()[0], wanted)
|
||||
self.assertEqual(stdout.readlines()[0], wanted)
|
||||
|
||||
def test_suite():
|
||||
return unittest.makeSuite(CoreTestCase)
|
||||
|
|
|
|||
|
|
@ -65,82 +65,82 @@ def test_check_config_h(self):
|
|||
sys.version = ('2.6.1 (r261:67515, Dec 6 2008, 16:42:21) \n[GCC '
|
||||
'4.0.1 (Apple Computer, Inc. build 5370)]')
|
||||
|
||||
self.assertEquals(check_config_h()[0], CONFIG_H_OK)
|
||||
self.assertEqual(check_config_h()[0], CONFIG_H_OK)
|
||||
|
||||
# then it tries to see if it can find "__GNUC__" in pyconfig.h
|
||||
sys.version = 'something without the *CC word'
|
||||
|
||||
# if the file doesn't exist it returns CONFIG_H_UNCERTAIN
|
||||
self.assertEquals(check_config_h()[0], CONFIG_H_UNCERTAIN)
|
||||
self.assertEqual(check_config_h()[0], CONFIG_H_UNCERTAIN)
|
||||
|
||||
# if it exists but does not contain __GNUC__, it returns CONFIG_H_NOTOK
|
||||
self.write_file(self.python_h, 'xxx')
|
||||
self.assertEquals(check_config_h()[0], CONFIG_H_NOTOK)
|
||||
self.assertEqual(check_config_h()[0], CONFIG_H_NOTOK)
|
||||
|
||||
# and CONFIG_H_OK if __GNUC__ is found
|
||||
self.write_file(self.python_h, 'xxx __GNUC__ xxx')
|
||||
self.assertEquals(check_config_h()[0], CONFIG_H_OK)
|
||||
self.assertEqual(check_config_h()[0], CONFIG_H_OK)
|
||||
|
||||
def test_get_versions(self):
|
||||
|
||||
# get_versions calls distutils.spawn.find_executable on
|
||||
# 'gcc', 'ld' and 'dllwrap'
|
||||
self.assertEquals(get_versions(), (None, None, None))
|
||||
self.assertEqual(get_versions(), (None, None, None))
|
||||
|
||||
# Let's fake we have 'gcc' and it returns '3.4.5'
|
||||
self._exes['gcc'] = b'gcc (GCC) 3.4.5 (mingw special)\nFSF'
|
||||
res = get_versions()
|
||||
self.assertEquals(str(res[0]), '3.4.5')
|
||||
self.assertEqual(str(res[0]), '3.4.5')
|
||||
|
||||
# and let's see what happens when the version
|
||||
# doesn't match the regular expression
|
||||
# (\d+\.\d+(\.\d+)*)
|
||||
self._exes['gcc'] = b'very strange output'
|
||||
res = get_versions()
|
||||
self.assertEquals(res[0], None)
|
||||
self.assertEqual(res[0], None)
|
||||
|
||||
# same thing for ld
|
||||
self._exes['ld'] = b'GNU ld version 2.17.50 20060824'
|
||||
res = get_versions()
|
||||
self.assertEquals(str(res[1]), '2.17.50')
|
||||
self.assertEqual(str(res[1]), '2.17.50')
|
||||
self._exes['ld'] = b'@(#)PROGRAM:ld PROJECT:ld64-77'
|
||||
res = get_versions()
|
||||
self.assertEquals(res[1], None)
|
||||
self.assertEqual(res[1], None)
|
||||
|
||||
# and dllwrap
|
||||
self._exes['dllwrap'] = b'GNU dllwrap 2.17.50 20060824\nFSF'
|
||||
res = get_versions()
|
||||
self.assertEquals(str(res[2]), '2.17.50')
|
||||
self.assertEqual(str(res[2]), '2.17.50')
|
||||
self._exes['dllwrap'] = b'Cheese Wrap'
|
||||
res = get_versions()
|
||||
self.assertEquals(res[2], None)
|
||||
self.assertEqual(res[2], None)
|
||||
|
||||
def test_get_msvcr(self):
|
||||
|
||||
# none
|
||||
sys.version = ('2.6.1 (r261:67515, Dec 6 2008, 16:42:21) '
|
||||
'\n[GCC 4.0.1 (Apple Computer, Inc. build 5370)]')
|
||||
self.assertEquals(get_msvcr(), None)
|
||||
self.assertEqual(get_msvcr(), None)
|
||||
|
||||
# MSVC 7.0
|
||||
sys.version = ('2.5.1 (r251:54863, Apr 18 2007, 08:51:08) '
|
||||
'[MSC v.1300 32 bits (Intel)]')
|
||||
self.assertEquals(get_msvcr(), ['msvcr70'])
|
||||
self.assertEqual(get_msvcr(), ['msvcr70'])
|
||||
|
||||
# MSVC 7.1
|
||||
sys.version = ('2.5.1 (r251:54863, Apr 18 2007, 08:51:08) '
|
||||
'[MSC v.1310 32 bits (Intel)]')
|
||||
self.assertEquals(get_msvcr(), ['msvcr71'])
|
||||
self.assertEqual(get_msvcr(), ['msvcr71'])
|
||||
|
||||
# VS2005 / MSVC 8.0
|
||||
sys.version = ('2.5.1 (r251:54863, Apr 18 2007, 08:51:08) '
|
||||
'[MSC v.1400 32 bits (Intel)]')
|
||||
self.assertEquals(get_msvcr(), ['msvcr80'])
|
||||
self.assertEqual(get_msvcr(), ['msvcr80'])
|
||||
|
||||
# VS2008 / MSVC 9.0
|
||||
sys.version = ('2.5.1 (r251:54863, Apr 18 2007, 08:51:08) '
|
||||
'[MSC v.1500 32 bits (Intel)]')
|
||||
self.assertEquals(get_msvcr(), ['msvcr90'])
|
||||
self.assertEqual(get_msvcr(), ['msvcr90'])
|
||||
|
||||
# unknown
|
||||
sys.version = ('2.5.1 (r251:54863, Apr 18 2007, 08:51:08) '
|
||||
|
|
|
|||
|
|
@ -37,18 +37,18 @@ def test_mkpath_remove_tree_verbosity(self):
|
|||
|
||||
mkpath(self.target, verbose=0)
|
||||
wanted = []
|
||||
self.assertEquals(self._logs, wanted)
|
||||
self.assertEqual(self._logs, wanted)
|
||||
remove_tree(self.root_target, verbose=0)
|
||||
|
||||
mkpath(self.target, verbose=1)
|
||||
wanted = ['creating %s' % self.root_target,
|
||||
'creating %s' % self.target]
|
||||
self.assertEquals(self._logs, wanted)
|
||||
self.assertEqual(self._logs, wanted)
|
||||
self._logs = []
|
||||
|
||||
remove_tree(self.root_target, verbose=1)
|
||||
wanted = ["removing '%s' (and everything under it)" % self.root_target]
|
||||
self.assertEquals(self._logs, wanted)
|
||||
self.assertEqual(self._logs, wanted)
|
||||
|
||||
@unittest.skipIf(sys.platform.startswith('win'),
|
||||
"This test is only appropriate for POSIX-like systems.")
|
||||
|
|
@ -66,12 +66,12 @@ def test_mkpath_with_custom_mode(self):
|
|||
def test_create_tree_verbosity(self):
|
||||
|
||||
create_tree(self.root_target, ['one', 'two', 'three'], verbose=0)
|
||||
self.assertEquals(self._logs, [])
|
||||
self.assertEqual(self._logs, [])
|
||||
remove_tree(self.root_target, verbose=0)
|
||||
|
||||
wanted = ['creating %s' % self.root_target]
|
||||
create_tree(self.root_target, ['one', 'two', 'three'], verbose=1)
|
||||
self.assertEquals(self._logs, wanted)
|
||||
self.assertEqual(self._logs, wanted)
|
||||
|
||||
remove_tree(self.root_target, verbose=0)
|
||||
|
||||
|
|
@ -81,7 +81,7 @@ def test_copy_tree_verbosity(self):
|
|||
mkpath(self.target, verbose=0)
|
||||
|
||||
copy_tree(self.target, self.target2, verbose=0)
|
||||
self.assertEquals(self._logs, [])
|
||||
self.assertEqual(self._logs, [])
|
||||
|
||||
remove_tree(self.root_target, verbose=0)
|
||||
|
||||
|
|
@ -95,18 +95,18 @@ def test_copy_tree_verbosity(self):
|
|||
|
||||
wanted = ['copying %s -> %s' % (a_file, self.target2)]
|
||||
copy_tree(self.target, self.target2, verbose=1)
|
||||
self.assertEquals(self._logs, wanted)
|
||||
self.assertEqual(self._logs, wanted)
|
||||
|
||||
remove_tree(self.root_target, verbose=0)
|
||||
remove_tree(self.target2, verbose=0)
|
||||
|
||||
def test_ensure_relative(self):
|
||||
if os.sep == '/':
|
||||
self.assertEquals(ensure_relative('/home/foo'), 'home/foo')
|
||||
self.assertEquals(ensure_relative('some/path'), 'some/path')
|
||||
self.assertEqual(ensure_relative('/home/foo'), 'home/foo')
|
||||
self.assertEqual(ensure_relative('some/path'), 'some/path')
|
||||
else: # \\
|
||||
self.assertEquals(ensure_relative('c:\\home\\foo'), 'c:home\\foo')
|
||||
self.assertEquals(ensure_relative('home\\foo'), 'home\\foo')
|
||||
self.assertEqual(ensure_relative('c:\\home\\foo'), 'c:home\\foo')
|
||||
self.assertEqual(ensure_relative('home\\foo'), 'home\\foo')
|
||||
|
||||
def test_suite():
|
||||
return unittest.makeSuite(DirUtilTestCase)
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@ def _warn(msg):
|
|||
finally:
|
||||
warnings.warn = old_warn
|
||||
|
||||
self.assertEquals(len(warns), 0)
|
||||
self.assertEqual(len(warns), 0)
|
||||
|
||||
def test_finalize_options(self):
|
||||
|
||||
|
|
@ -136,20 +136,20 @@ def test_finalize_options(self):
|
|||
dist.finalize_options()
|
||||
|
||||
# finalize_option splits platforms and keywords
|
||||
self.assertEquals(dist.metadata.platforms, ['one', 'two'])
|
||||
self.assertEquals(dist.metadata.keywords, ['one', 'two'])
|
||||
self.assertEqual(dist.metadata.platforms, ['one', 'two'])
|
||||
self.assertEqual(dist.metadata.keywords, ['one', 'two'])
|
||||
|
||||
def test_get_command_packages(self):
|
||||
dist = Distribution()
|
||||
self.assertEquals(dist.command_packages, None)
|
||||
self.assertEqual(dist.command_packages, None)
|
||||
cmds = dist.get_command_packages()
|
||||
self.assertEquals(cmds, ['distutils.command'])
|
||||
self.assertEquals(dist.command_packages,
|
||||
['distutils.command'])
|
||||
self.assertEqual(cmds, ['distutils.command'])
|
||||
self.assertEqual(dist.command_packages,
|
||||
['distutils.command'])
|
||||
|
||||
dist.command_packages = 'one,two'
|
||||
cmds = dist.get_command_packages()
|
||||
self.assertEquals(cmds, ['distutils.command', 'one', 'two'])
|
||||
self.assertEqual(cmds, ['distutils.command', 'one', 'two'])
|
||||
|
||||
|
||||
def test_announce(self):
|
||||
|
|
@ -288,8 +288,8 @@ def test_custom_pydistutils(self):
|
|||
def test_fix_help_options(self):
|
||||
help_tuples = [('a', 'b', 'c', 'd'), (1, 2, 3, 4)]
|
||||
fancy_options = fix_help_options(help_tuples)
|
||||
self.assertEquals(fancy_options[0], ('a', 'b', 'c'))
|
||||
self.assertEquals(fancy_options[1], (1, 2, 3))
|
||||
self.assertEqual(fancy_options[0], ('a', 'b', 'c'))
|
||||
self.assertEqual(fancy_options[1], (1, 2, 3))
|
||||
|
||||
def test_show_help(self):
|
||||
# smoke test, just makes sure some help is displayed
|
||||
|
|
|
|||
|
|
@ -28,38 +28,38 @@ def test_read_setup_file(self):
|
|||
'rect', 'rwobject', 'scrap', 'surface', 'surflock',
|
||||
'time', 'transform']
|
||||
|
||||
self.assertEquals(names, wanted)
|
||||
self.assertEqual(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')
|
||||
self.assertEqual(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'])
|
||||
self.assertEqual(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.assertEqual(getattr(ext, attr), [])
|
||||
|
||||
self.assertEquals(ext.language, None)
|
||||
self.assertEquals(ext.optional, None)
|
||||
self.assertEqual(ext.language, None)
|
||||
self.assertEqual(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),
|
||||
self.assertEqual(len(w.warnings), 1)
|
||||
self.assertEqual(str(w.warnings[0].message),
|
||||
"Unknown Extension options: 'chic'")
|
||||
|
||||
def test_suite():
|
||||
|
|
|
|||
|
|
@ -38,14 +38,14 @@ def test_move_file_verbosity(self):
|
|||
|
||||
move_file(self.source, self.target, verbose=0)
|
||||
wanted = []
|
||||
self.assertEquals(self._logs, wanted)
|
||||
self.assertEqual(self._logs, wanted)
|
||||
|
||||
# back to original state
|
||||
move_file(self.target, self.source, verbose=0)
|
||||
|
||||
move_file(self.source, self.target, verbose=1)
|
||||
wanted = ['moving %s -> %s' % (self.source, self.target)]
|
||||
self.assertEquals(self._logs, wanted)
|
||||
self.assertEqual(self._logs, wanted)
|
||||
|
||||
# back to original state
|
||||
move_file(self.target, self.source, verbose=0)
|
||||
|
|
@ -55,7 +55,7 @@ def test_move_file_verbosity(self):
|
|||
os.mkdir(self.target_dir)
|
||||
move_file(self.source, self.target_dir, verbose=1)
|
||||
wanted = ['moving %s -> %s' % (self.source, self.target_dir)]
|
||||
self.assertEquals(self._logs, wanted)
|
||||
self.assertEqual(self._logs, wanted)
|
||||
|
||||
|
||||
def test_suite():
|
||||
|
|
|
|||
|
|
@ -9,29 +9,29 @@ class FileListTestCase(unittest.TestCase):
|
|||
|
||||
def test_glob_to_re(self):
|
||||
# simple cases
|
||||
self.assertEquals(glob_to_re('foo*'), 'foo[^/]*\\Z(?ms)')
|
||||
self.assertEquals(glob_to_re('foo?'), 'foo[^/]\\Z(?ms)')
|
||||
self.assertEquals(glob_to_re('foo??'), 'foo[^/][^/]\\Z(?ms)')
|
||||
self.assertEqual(glob_to_re('foo*'), 'foo[^/]*\\Z(?ms)')
|
||||
self.assertEqual(glob_to_re('foo?'), 'foo[^/]\\Z(?ms)')
|
||||
self.assertEqual(glob_to_re('foo??'), 'foo[^/][^/]\\Z(?ms)')
|
||||
|
||||
# special cases
|
||||
self.assertEquals(glob_to_re(r'foo\\*'), r'foo\\\\[^/]*\Z(?ms)')
|
||||
self.assertEquals(glob_to_re(r'foo\\\*'), r'foo\\\\\\[^/]*\Z(?ms)')
|
||||
self.assertEquals(glob_to_re('foo????'), r'foo[^/][^/][^/][^/]\Z(?ms)')
|
||||
self.assertEquals(glob_to_re(r'foo\\??'), r'foo\\\\[^/][^/]\Z(?ms)')
|
||||
self.assertEqual(glob_to_re(r'foo\\*'), r'foo\\\\[^/]*\Z(?ms)')
|
||||
self.assertEqual(glob_to_re(r'foo\\\*'), r'foo\\\\\\[^/]*\Z(?ms)')
|
||||
self.assertEqual(glob_to_re('foo????'), r'foo[^/][^/][^/][^/]\Z(?ms)')
|
||||
self.assertEqual(glob_to_re(r'foo\\??'), r'foo\\\\[^/][^/]\Z(?ms)')
|
||||
|
||||
def test_debug_print(self):
|
||||
file_list = FileList()
|
||||
with captured_stdout() as stdout:
|
||||
file_list.debug_print('xxx')
|
||||
stdout.seek(0)
|
||||
self.assertEquals(stdout.read(), '')
|
||||
self.assertEqual(stdout.read(), '')
|
||||
|
||||
debug.DEBUG = True
|
||||
try:
|
||||
with captured_stdout() as stdout:
|
||||
file_list.debug_print('xxx')
|
||||
stdout.seek(0)
|
||||
self.assertEquals(stdout.read(), 'xxx\n')
|
||||
self.assertEqual(stdout.read(), 'xxx\n')
|
||||
finally:
|
||||
debug.DEBUG = False
|
||||
|
||||
|
|
|
|||
|
|
@ -123,23 +123,23 @@ def test_handle_extra_path(self):
|
|||
|
||||
# two elements
|
||||
cmd.handle_extra_path()
|
||||
self.assertEquals(cmd.extra_path, ['path', 'dirs'])
|
||||
self.assertEquals(cmd.extra_dirs, 'dirs')
|
||||
self.assertEquals(cmd.path_file, 'path')
|
||||
self.assertEqual(cmd.extra_path, ['path', 'dirs'])
|
||||
self.assertEqual(cmd.extra_dirs, 'dirs')
|
||||
self.assertEqual(cmd.path_file, 'path')
|
||||
|
||||
# one element
|
||||
cmd.extra_path = ['path']
|
||||
cmd.handle_extra_path()
|
||||
self.assertEquals(cmd.extra_path, ['path'])
|
||||
self.assertEquals(cmd.extra_dirs, 'path')
|
||||
self.assertEquals(cmd.path_file, 'path')
|
||||
self.assertEqual(cmd.extra_path, ['path'])
|
||||
self.assertEqual(cmd.extra_dirs, 'path')
|
||||
self.assertEqual(cmd.path_file, 'path')
|
||||
|
||||
# none
|
||||
dist.extra_path = cmd.extra_path = None
|
||||
cmd.handle_extra_path()
|
||||
self.assertEquals(cmd.extra_path, None)
|
||||
self.assertEquals(cmd.extra_dirs, '')
|
||||
self.assertEquals(cmd.path_file, None)
|
||||
self.assertEqual(cmd.extra_path, None)
|
||||
self.assertEqual(cmd.extra_dirs, '')
|
||||
self.assertEqual(cmd.path_file, None)
|
||||
|
||||
# three elements (no way !)
|
||||
cmd.extra_path = 'path,dirs,again'
|
||||
|
|
@ -184,7 +184,7 @@ def test_record(self):
|
|||
# line (the egg info file)
|
||||
f = open(cmd.record)
|
||||
try:
|
||||
self.assertEquals(len(f.readlines()), 1)
|
||||
self.assertEqual(len(f.readlines()), 1)
|
||||
finally:
|
||||
f.close()
|
||||
|
||||
|
|
|
|||
|
|
@ -27,14 +27,14 @@ def test_simple_run(self):
|
|||
self.write_file(two, 'xxx')
|
||||
|
||||
cmd.data_files = [one, (inst2, [two])]
|
||||
self.assertEquals(cmd.get_inputs(), [one, (inst2, [two])])
|
||||
self.assertEqual(cmd.get_inputs(), [one, (inst2, [two])])
|
||||
|
||||
# let's run the command
|
||||
cmd.ensure_finalized()
|
||||
cmd.run()
|
||||
|
||||
# let's check the result
|
||||
self.assertEquals(len(cmd.get_outputs()), 2)
|
||||
self.assertEqual(len(cmd.get_outputs()), 2)
|
||||
rtwo = os.path.split(two)[-1]
|
||||
self.assertTrue(os.path.exists(os.path.join(inst2, rtwo)))
|
||||
rone = os.path.split(one)[-1]
|
||||
|
|
@ -47,7 +47,7 @@ def test_simple_run(self):
|
|||
cmd.run()
|
||||
|
||||
# let's check the result
|
||||
self.assertEquals(len(cmd.get_outputs()), 2)
|
||||
self.assertEqual(len(cmd.get_outputs()), 2)
|
||||
self.assertTrue(os.path.exists(os.path.join(inst2, rtwo)))
|
||||
self.assertTrue(os.path.exists(os.path.join(inst, rone)))
|
||||
cmd.outfiles = []
|
||||
|
|
@ -65,7 +65,7 @@ def test_simple_run(self):
|
|||
cmd.run()
|
||||
|
||||
# let's check the result
|
||||
self.assertEquals(len(cmd.get_outputs()), 4)
|
||||
self.assertEqual(len(cmd.get_outputs()), 4)
|
||||
self.assertTrue(os.path.exists(os.path.join(inst2, rtwo)))
|
||||
self.assertTrue(os.path.exists(os.path.join(inst, rone)))
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ def test_simple_run(self):
|
|||
|
||||
pkg_dir, dist = self.create_dist(headers=headers)
|
||||
cmd = install_headers(dist)
|
||||
self.assertEquals(cmd.get_inputs(), headers)
|
||||
self.assertEqual(cmd.get_inputs(), headers)
|
||||
|
||||
# let's run the command
|
||||
cmd.install_dir = os.path.join(pkg_dir, 'inst')
|
||||
|
|
@ -31,7 +31,7 @@ def test_simple_run(self):
|
|||
cmd.run()
|
||||
|
||||
# let's check the results
|
||||
self.assertEquals(len(cmd.get_outputs()), 2)
|
||||
self.assertEqual(len(cmd.get_outputs()), 2)
|
||||
|
||||
def test_suite():
|
||||
return unittest.makeSuite(InstallHeadersTestCase)
|
||||
|
|
|
|||
|
|
@ -18,8 +18,8 @@ def test_finalize_options(self):
|
|||
cmd = install_lib(dist)
|
||||
|
||||
cmd.finalize_options()
|
||||
self.assertEquals(cmd.compile, 1)
|
||||
self.assertEquals(cmd.optimize, 0)
|
||||
self.assertEqual(cmd.compile, 1)
|
||||
self.assertEqual(cmd.optimize, 0)
|
||||
|
||||
# optimize must be 0, 1, or 2
|
||||
cmd.optimize = 'foo'
|
||||
|
|
@ -29,7 +29,7 @@ def test_finalize_options(self):
|
|||
|
||||
cmd.optimize = '2'
|
||||
cmd.finalize_options()
|
||||
self.assertEquals(cmd.optimize, 2)
|
||||
self.assertEqual(cmd.optimize, 2)
|
||||
|
||||
@unittest.skipUnless(not sys.dont_write_bytecode,
|
||||
'byte-compile not supported')
|
||||
|
|
@ -76,7 +76,7 @@ def test_get_inputs(self):
|
|||
cmd.distribution.script_name = 'setup.py'
|
||||
|
||||
# get_input should return 2 elements
|
||||
self.assertEquals(len(cmd.get_inputs()), 2)
|
||||
self.assertEqual(len(cmd.get_inputs()), 2)
|
||||
|
||||
def test_dont_write_bytecode(self):
|
||||
# makes sure byte_compile is not used
|
||||
|
|
|
|||
|
|
@ -22,9 +22,9 @@ def test_non_ascii(self):
|
|||
log.debug("debug:\xe9")
|
||||
log.fatal("fatal:\xe9")
|
||||
stdout.seek(0)
|
||||
self.assertEquals(stdout.read().rstrip(), "debug:\\xe9")
|
||||
self.assertEqual(stdout.read().rstrip(), "debug:\\xe9")
|
||||
stderr.seek(0)
|
||||
self.assertEquals(stderr.read().rstrip(), "fatal:\\xe9")
|
||||
self.assertEqual(stderr.read().rstrip(), "fatal:\\xe9")
|
||||
finally:
|
||||
sys.stdout = old_stdout
|
||||
sys.stderr = old_stderr
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ def test_reg_class(self):
|
|||
import winreg
|
||||
HKCU = winreg.HKEY_CURRENT_USER
|
||||
keys = Reg.read_keys(HKCU, 'xxxx')
|
||||
self.assertEquals(keys, None)
|
||||
self.assertEqual(keys, None)
|
||||
|
||||
keys = Reg.read_keys(HKCU, r'Control Panel')
|
||||
self.assertTrue('Desktop' in keys)
|
||||
|
|
@ -130,7 +130,7 @@ def test_remove_visual_c_ref(self):
|
|||
f.close()
|
||||
|
||||
# makes sure the manifest was properly cleaned
|
||||
self.assertEquals(content, _CLEANED_MANIFEST)
|
||||
self.assertEqual(content, _CLEANED_MANIFEST)
|
||||
|
||||
|
||||
def test_suite():
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ def test_create_pypirc(self):
|
|||
f = open(self.rc)
|
||||
try:
|
||||
content = f.read()
|
||||
self.assertEquals(content, WANTED_PYPIRC)
|
||||
self.assertEqual(content, WANTED_PYPIRC)
|
||||
finally:
|
||||
f.close()
|
||||
|
||||
|
|
@ -141,8 +141,8 @@ def _no_way(prompt=''):
|
|||
req1 = dict(self.conn.reqs[0].headers)
|
||||
req2 = dict(self.conn.reqs[1].headers)
|
||||
|
||||
self.assertEquals(req1['Content-length'], '1374')
|
||||
self.assertEquals(req2['Content-length'], '1374')
|
||||
self.assertEqual(req1['Content-length'], '1374')
|
||||
self.assertEqual(req2['Content-length'], '1374')
|
||||
self.assertTrue((b'xxx') in self.conn.reqs[1].data)
|
||||
|
||||
def test_password_not_in_file(self):
|
||||
|
|
@ -155,7 +155,7 @@ def test_password_not_in_file(self):
|
|||
|
||||
# dist.password should be set
|
||||
# therefore used afterwards by other commands
|
||||
self.assertEquals(cmd.distribution.password, 'password')
|
||||
self.assertEqual(cmd.distribution.password, 'password')
|
||||
|
||||
def test_registering(self):
|
||||
# this test runs choice 2
|
||||
|
|
@ -172,7 +172,7 @@ def test_registering(self):
|
|||
self.assertTrue(self.conn.reqs, 1)
|
||||
req = self.conn.reqs[0]
|
||||
headers = dict(req.headers)
|
||||
self.assertEquals(headers['Content-length'], '608')
|
||||
self.assertEqual(headers['Content-length'], '608')
|
||||
self.assertTrue((b'tarek') in req.data)
|
||||
|
||||
def test_password_reset(self):
|
||||
|
|
@ -190,7 +190,7 @@ def test_password_reset(self):
|
|||
self.assertTrue(self.conn.reqs, 1)
|
||||
req = self.conn.reqs[0]
|
||||
headers = dict(req.headers)
|
||||
self.assertEquals(headers['Content-length'], '290')
|
||||
self.assertEqual(headers['Content-length'], '290')
|
||||
self.assertTrue((b'tarek') in req.data)
|
||||
|
||||
def test_strict(self):
|
||||
|
|
@ -253,7 +253,7 @@ def test_check_metadata_deprecated(self):
|
|||
with check_warnings() as w:
|
||||
warnings.simplefilter("always")
|
||||
cmd.check_metadata()
|
||||
self.assertEquals(len(w.warnings), 1)
|
||||
self.assertEqual(len(w.warnings), 1)
|
||||
|
||||
def test_suite():
|
||||
return unittest.makeSuite(RegisterTestCase)
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ def test_prune_file_list(self):
|
|||
# now let's check what we have
|
||||
dist_folder = join(self.tmp_dir, 'dist')
|
||||
files = os.listdir(dist_folder)
|
||||
self.assertEquals(files, ['fake-1.0.zip'])
|
||||
self.assertEqual(files, ['fake-1.0.zip'])
|
||||
|
||||
zip_file = zipfile.ZipFile(join(dist_folder, 'fake-1.0.zip'))
|
||||
try:
|
||||
|
|
@ -119,7 +119,7 @@ def test_prune_file_list(self):
|
|||
zip_file.close()
|
||||
|
||||
# making sure everything has been pruned correctly
|
||||
self.assertEquals(len(content), 4)
|
||||
self.assertEqual(len(content), 4)
|
||||
|
||||
def test_make_distribution(self):
|
||||
|
||||
|
|
@ -140,8 +140,7 @@ def test_make_distribution(self):
|
|||
dist_folder = join(self.tmp_dir, 'dist')
|
||||
result = os.listdir(dist_folder)
|
||||
result.sort()
|
||||
self.assertEquals(result,
|
||||
['fake-1.0.tar', 'fake-1.0.tar.gz'] )
|
||||
self.assertEqual(result, ['fake-1.0.tar', 'fake-1.0.tar.gz'] )
|
||||
|
||||
os.remove(join(dist_folder, 'fake-1.0.tar'))
|
||||
os.remove(join(dist_folder, 'fake-1.0.tar.gz'))
|
||||
|
|
@ -154,8 +153,7 @@ def test_make_distribution(self):
|
|||
|
||||
result = os.listdir(dist_folder)
|
||||
result.sort()
|
||||
self.assertEquals(result,
|
||||
['fake-1.0.tar', 'fake-1.0.tar.gz'])
|
||||
self.assertEqual(result, ['fake-1.0.tar', 'fake-1.0.tar.gz'])
|
||||
|
||||
def test_add_defaults(self):
|
||||
|
||||
|
|
@ -203,7 +201,7 @@ def test_add_defaults(self):
|
|||
# now let's check what we have
|
||||
dist_folder = join(self.tmp_dir, 'dist')
|
||||
files = os.listdir(dist_folder)
|
||||
self.assertEquals(files, ['fake-1.0.zip'])
|
||||
self.assertEqual(files, ['fake-1.0.zip'])
|
||||
|
||||
zip_file = zipfile.ZipFile(join(dist_folder, 'fake-1.0.zip'))
|
||||
try:
|
||||
|
|
@ -212,13 +210,13 @@ def test_add_defaults(self):
|
|||
zip_file.close()
|
||||
|
||||
# making sure everything was added
|
||||
self.assertEquals(len(content), 11)
|
||||
self.assertEqual(len(content), 11)
|
||||
|
||||
# checking the MANIFEST
|
||||
f = open(join(self.tmp_dir, 'MANIFEST'))
|
||||
try:
|
||||
manifest = f.read()
|
||||
self.assertEquals(manifest, MANIFEST % {'sep': os.sep})
|
||||
self.assertEqual(manifest, MANIFEST % {'sep': os.sep})
|
||||
finally:
|
||||
f.close()
|
||||
|
||||
|
|
@ -231,7 +229,7 @@ def test_metadata_check_option(self):
|
|||
cmd.ensure_finalized()
|
||||
cmd.run()
|
||||
warnings = self.get_logs(WARN)
|
||||
self.assertEquals(len(warnings), 2)
|
||||
self.assertEqual(len(warnings), 2)
|
||||
|
||||
# trying with a complete set of metadata
|
||||
self.clear_logs()
|
||||
|
|
@ -240,7 +238,7 @@ def test_metadata_check_option(self):
|
|||
cmd.metadata_check = 0
|
||||
cmd.run()
|
||||
warnings = self.get_logs(WARN)
|
||||
self.assertEquals(len(warnings), 0)
|
||||
self.assertEqual(len(warnings), 0)
|
||||
|
||||
def test_check_metadata_deprecated(self):
|
||||
# makes sure make_metadata is deprecated
|
||||
|
|
@ -248,7 +246,7 @@ def test_check_metadata_deprecated(self):
|
|||
with check_warnings() as w:
|
||||
warnings.simplefilter("always")
|
||||
cmd.check_metadata()
|
||||
self.assertEquals(len(w.warnings), 1)
|
||||
self.assertEqual(len(w.warnings), 1)
|
||||
|
||||
def test_show_formats(self):
|
||||
with captured_stdout() as stdout:
|
||||
|
|
@ -258,7 +256,7 @@ def test_show_formats(self):
|
|||
num_formats = len(ARCHIVE_FORMATS.keys())
|
||||
output = [line for line in stdout.getvalue().split('\n')
|
||||
if line.strip().startswith('--formats=')]
|
||||
self.assertEquals(len(output), num_formats)
|
||||
self.assertEqual(len(output), num_formats)
|
||||
|
||||
def test_finalize_options(self):
|
||||
|
||||
|
|
@ -266,9 +264,9 @@ def test_finalize_options(self):
|
|||
cmd.finalize_options()
|
||||
|
||||
# default options set by finalize
|
||||
self.assertEquals(cmd.manifest, 'MANIFEST')
|
||||
self.assertEquals(cmd.template, 'MANIFEST.in')
|
||||
self.assertEquals(cmd.dist_dir, 'dist')
|
||||
self.assertEqual(cmd.manifest, 'MANIFEST')
|
||||
self.assertEqual(cmd.template, 'MANIFEST.in')
|
||||
self.assertEqual(cmd.dist_dir, 'dist')
|
||||
|
||||
# formats has to be a string splitable on (' ', ',') or
|
||||
# a stringlist
|
||||
|
|
@ -299,7 +297,7 @@ def test_get_file_list(self):
|
|||
finally:
|
||||
f.close()
|
||||
|
||||
self.assertEquals(len(manifest), 5)
|
||||
self.assertEqual(len(manifest), 5)
|
||||
|
||||
# adding a file
|
||||
self.write_file((self.tmp_dir, 'somecode', 'doc2.txt'), '#')
|
||||
|
|
@ -319,7 +317,7 @@ def test_get_file_list(self):
|
|||
f.close()
|
||||
|
||||
# do we have the new file in MANIFEST ?
|
||||
self.assertEquals(len(manifest2), 6)
|
||||
self.assertEqual(len(manifest2), 6)
|
||||
self.assertIn('doc2.txt', manifest2[-1])
|
||||
|
||||
def test_manifest_marker(self):
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ def test_nt_quote_args(self):
|
|||
(['nochange', 'nospace'],
|
||||
['nochange', 'nospace'])):
|
||||
res = _nt_quote_args(args)
|
||||
self.assertEquals(res, wanted)
|
||||
self.assertEqual(res, wanted)
|
||||
|
||||
|
||||
@unittest.skipUnless(os.name in ('nt', 'posix'),
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ def set_executables(self, **kw):
|
|||
|
||||
comp = compiler()
|
||||
sysconfig.customize_compiler(comp)
|
||||
self.assertEquals(comp.exes['archiver'], 'my_ar -arflags')
|
||||
self.assertEqual(comp.exes['archiver'], 'my_ar -arflags')
|
||||
|
||||
def test_parse_makefile_base(self):
|
||||
self.makefile = TESTFN
|
||||
|
|
@ -82,7 +82,7 @@ def test_parse_makefile_base(self):
|
|||
finally:
|
||||
fd.close()
|
||||
d = sysconfig.parse_makefile(self.makefile)
|
||||
self.assertEquals(d, {'CONFIG_ARGS': "'--arg1=optarg1' 'ENV=LIB'",
|
||||
self.assertEqual(d, {'CONFIG_ARGS': "'--arg1=optarg1' 'ENV=LIB'",
|
||||
'OTHER': 'foo'})
|
||||
|
||||
def test_parse_makefile_literal_dollar(self):
|
||||
|
|
@ -94,8 +94,8 @@ def test_parse_makefile_literal_dollar(self):
|
|||
finally:
|
||||
fd.close()
|
||||
d = sysconfig.parse_makefile(self.makefile)
|
||||
self.assertEquals(d, {'CONFIG_ARGS': r"'--arg1=optarg1' 'ENV=\$LIB'",
|
||||
'OTHER': 'foo'})
|
||||
self.assertEqual(d, {'CONFIG_ARGS': r"'--arg1=optarg1' 'ENV=\$LIB'",
|
||||
'OTHER': 'foo'})
|
||||
|
||||
|
||||
def test_suite():
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ def test_class(self):
|
|||
|
||||
def test_input(count, description, file, expected_result):
|
||||
result = file.readlines()
|
||||
self.assertEquals(result, expected_result)
|
||||
self.assertEqual(result, expected_result)
|
||||
|
||||
tmpdir = self.mkdtemp()
|
||||
filename = os.path.join(tmpdir, "test.txt")
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ def test_finalize_options(self):
|
|||
for attr, waited in (('username', 'me'), ('password', 'secret'),
|
||||
('realm', 'pypi'),
|
||||
('repository', 'http://pypi.python.org/pypi')):
|
||||
self.assertEquals(getattr(cmd, attr), waited)
|
||||
self.assertEqual(getattr(cmd, attr), waited)
|
||||
|
||||
def test_saved_password(self):
|
||||
# file with no password
|
||||
|
|
@ -100,14 +100,14 @@ def test_saved_password(self):
|
|||
dist = Distribution()
|
||||
cmd = upload(dist)
|
||||
cmd.finalize_options()
|
||||
self.assertEquals(cmd.password, None)
|
||||
self.assertEqual(cmd.password, None)
|
||||
|
||||
# make sure we get it as well, if another command
|
||||
# initialized it at the dist level
|
||||
dist.password = 'xxx'
|
||||
cmd = upload(dist)
|
||||
cmd.finalize_options()
|
||||
self.assertEquals(cmd.password, 'xxx')
|
||||
self.assertEqual(cmd.password, 'xxx')
|
||||
|
||||
def test_upload(self):
|
||||
tmp = self.mkdtemp()
|
||||
|
|
@ -125,12 +125,12 @@ def test_upload(self):
|
|||
|
||||
# what did we send ?
|
||||
headers = dict(self.conn.headers)
|
||||
self.assertEquals(headers['Content-length'], '2087')
|
||||
self.assertEqual(headers['Content-length'], '2087')
|
||||
self.assertTrue(headers['Content-type'].startswith('multipart/form-data'))
|
||||
self.assertFalse('\n' in headers['Authorization'])
|
||||
|
||||
self.assertEquals(self.conn.requests, [('POST', '/pypi')])
|
||||
self.assert_((b'xxx') in self.conn.body)
|
||||
self.assertEqual(self.conn.requests, [('POST', '/pypi')])
|
||||
self.assertTrue((b'xxx') in self.conn.body)
|
||||
|
||||
def test_suite():
|
||||
return unittest.makeSuite(uploadTestCase)
|
||||
|
|
|
|||
|
|
@ -66,21 +66,21 @@ def test_get_platform(self):
|
|||
sys.version = ('2.4.4 (#71, Oct 18 2006, 08:34:43) '
|
||||
'[MSC v.1310 32 bit (Intel)]')
|
||||
sys.platform = 'win32'
|
||||
self.assertEquals(get_platform(), 'win32')
|
||||
self.assertEqual(get_platform(), 'win32')
|
||||
|
||||
# windows XP, amd64
|
||||
os.name = 'nt'
|
||||
sys.version = ('2.4.4 (#71, Oct 18 2006, 08:34:43) '
|
||||
'[MSC v.1310 32 bit (Amd64)]')
|
||||
sys.platform = 'win32'
|
||||
self.assertEquals(get_platform(), 'win-amd64')
|
||||
self.assertEqual(get_platform(), 'win-amd64')
|
||||
|
||||
# windows XP, itanium
|
||||
os.name = 'nt'
|
||||
sys.version = ('2.4.4 (#71, Oct 18 2006, 08:34:43) '
|
||||
'[MSC v.1310 32 bit (Itanium)]')
|
||||
sys.platform = 'win32'
|
||||
self.assertEquals(get_platform(), 'win-ia64')
|
||||
self.assertEqual(get_platform(), 'win-ia64')
|
||||
|
||||
# macbook
|
||||
os.name = 'posix'
|
||||
|
|
@ -99,7 +99,7 @@ def test_get_platform(self):
|
|||
cursize = sys.maxsize
|
||||
sys.maxsize = (2 ** 31)-1
|
||||
try:
|
||||
self.assertEquals(get_platform(), 'macosx-10.3-i386')
|
||||
self.assertEqual(get_platform(), 'macosx-10.3-i386')
|
||||
finally:
|
||||
sys.maxsize = cursize
|
||||
|
||||
|
|
@ -110,33 +110,33 @@ def test_get_platform(self):
|
|||
'-fno-strict-aliasing -fno-common '
|
||||
'-dynamic -DNDEBUG -g -O3')
|
||||
|
||||
self.assertEquals(get_platform(), 'macosx-10.4-fat')
|
||||
self.assertEqual(get_platform(), 'macosx-10.4-fat')
|
||||
|
||||
get_config_vars()['CFLAGS'] = ('-arch x86_64 -arch i386 -isysroot '
|
||||
'/Developer/SDKs/MacOSX10.4u.sdk '
|
||||
'-fno-strict-aliasing -fno-common '
|
||||
'-dynamic -DNDEBUG -g -O3')
|
||||
|
||||
self.assertEquals(get_platform(), 'macosx-10.4-intel')
|
||||
self.assertEqual(get_platform(), 'macosx-10.4-intel')
|
||||
|
||||
get_config_vars()['CFLAGS'] = ('-arch x86_64 -arch ppc -arch i386 -isysroot '
|
||||
'/Developer/SDKs/MacOSX10.4u.sdk '
|
||||
'-fno-strict-aliasing -fno-common '
|
||||
'-dynamic -DNDEBUG -g -O3')
|
||||
self.assertEquals(get_platform(), 'macosx-10.4-fat3')
|
||||
self.assertEqual(get_platform(), 'macosx-10.4-fat3')
|
||||
|
||||
get_config_vars()['CFLAGS'] = ('-arch ppc64 -arch x86_64 -arch ppc -arch i386 -isysroot '
|
||||
'/Developer/SDKs/MacOSX10.4u.sdk '
|
||||
'-fno-strict-aliasing -fno-common '
|
||||
'-dynamic -DNDEBUG -g -O3')
|
||||
self.assertEquals(get_platform(), 'macosx-10.4-universal')
|
||||
self.assertEqual(get_platform(), 'macosx-10.4-universal')
|
||||
|
||||
get_config_vars()['CFLAGS'] = ('-arch x86_64 -arch ppc64 -isysroot '
|
||||
'/Developer/SDKs/MacOSX10.4u.sdk '
|
||||
'-fno-strict-aliasing -fno-common '
|
||||
'-dynamic -DNDEBUG -g -O3')
|
||||
|
||||
self.assertEquals(get_platform(), 'macosx-10.4-fat64')
|
||||
self.assertEqual(get_platform(), 'macosx-10.4-fat64')
|
||||
|
||||
for arch in ('ppc', 'i386', 'x86_64', 'ppc64'):
|
||||
get_config_vars()['CFLAGS'] = ('-arch %s -isysroot '
|
||||
|
|
@ -144,7 +144,7 @@ def test_get_platform(self):
|
|||
'-fno-strict-aliasing -fno-common '
|
||||
'-dynamic -DNDEBUG -g -O3'%(arch,))
|
||||
|
||||
self.assertEquals(get_platform(), 'macosx-10.4-%s'%(arch,))
|
||||
self.assertEqual(get_platform(), 'macosx-10.4-%s'%(arch,))
|
||||
|
||||
# linux debian sarge
|
||||
os.name = 'posix'
|
||||
|
|
@ -154,7 +154,7 @@ def test_get_platform(self):
|
|||
self._set_uname(('Linux', 'aglae', '2.6.21.1dedibox-r7',
|
||||
'#1 Mon Apr 30 17:25:38 CEST 2007', 'i686'))
|
||||
|
||||
self.assertEquals(get_platform(), 'linux-i686')
|
||||
self.assertEqual(get_platform(), 'linux-i686')
|
||||
|
||||
# XXX more platforms to tests here
|
||||
|
||||
|
|
@ -165,8 +165,8 @@ def _join(path):
|
|||
return '/'.join(path)
|
||||
os.path.join = _join
|
||||
|
||||
self.assertEquals(convert_path('/home/to/my/stuff'),
|
||||
'/home/to/my/stuff')
|
||||
self.assertEqual(convert_path('/home/to/my/stuff'),
|
||||
'/home/to/my/stuff')
|
||||
|
||||
# win
|
||||
os.sep = '\\'
|
||||
|
|
@ -177,10 +177,10 @@ def _join(*path):
|
|||
self.assertRaises(ValueError, convert_path, '/home/to/my/stuff')
|
||||
self.assertRaises(ValueError, convert_path, 'home/to/my/stuff/')
|
||||
|
||||
self.assertEquals(convert_path('home/to/my/stuff'),
|
||||
'home\\to\\my\\stuff')
|
||||
self.assertEquals(convert_path('.'),
|
||||
os.curdir)
|
||||
self.assertEqual(convert_path('home/to/my/stuff'),
|
||||
'home\\to\\my\\stuff')
|
||||
self.assertEqual(convert_path('.'),
|
||||
os.curdir)
|
||||
|
||||
def test_change_root(self):
|
||||
# linux/mac
|
||||
|
|
@ -192,10 +192,10 @@ def _join(*path):
|
|||
return '/'.join(path)
|
||||
os.path.join = _join
|
||||
|
||||
self.assertEquals(change_root('/root', '/old/its/here'),
|
||||
'/root/old/its/here')
|
||||
self.assertEquals(change_root('/root', 'its/here'),
|
||||
'/root/its/here')
|
||||
self.assertEqual(change_root('/root', '/old/its/here'),
|
||||
'/root/old/its/here')
|
||||
self.assertEqual(change_root('/root', 'its/here'),
|
||||
'/root/its/here')
|
||||
|
||||
# windows
|
||||
os.name = 'nt'
|
||||
|
|
@ -211,10 +211,10 @@ def _join(*path):
|
|||
return '\\'.join(path)
|
||||
os.path.join = _join
|
||||
|
||||
self.assertEquals(change_root('c:\\root', 'c:\\old\\its\\here'),
|
||||
'c:\\root\\old\\its\\here')
|
||||
self.assertEquals(change_root('c:\\root', 'its\\here'),
|
||||
'c:\\root\\its\\here')
|
||||
self.assertEqual(change_root('c:\\root', 'c:\\old\\its\\here'),
|
||||
'c:\\root\\old\\its\\here')
|
||||
self.assertEqual(change_root('c:\\root', 'its\\here'),
|
||||
'c:\\root\\its\\here')
|
||||
|
||||
# BugsBunny os (it's a great os)
|
||||
os.name = 'BugsBunny'
|
||||
|
|
@ -232,16 +232,16 @@ def test_check_environ(self):
|
|||
if os.name == 'posix': # this test won't run on windows
|
||||
check_environ()
|
||||
import pwd
|
||||
self.assertEquals(os.environ['HOME'], pwd.getpwuid(os.getuid())[5])
|
||||
self.assertEqual(os.environ['HOME'], pwd.getpwuid(os.getuid())[5])
|
||||
else:
|
||||
check_environ()
|
||||
|
||||
self.assertEquals(os.environ['PLAT'], get_platform())
|
||||
self.assertEquals(util._environ_checked, 1)
|
||||
self.assertEqual(os.environ['PLAT'], get_platform())
|
||||
self.assertEqual(util._environ_checked, 1)
|
||||
|
||||
def test_split_quoted(self):
|
||||
self.assertEquals(split_quoted('""one"" "two" \'three\' \\four'),
|
||||
['one', 'two', 'three', 'four'])
|
||||
self.assertEqual(split_quoted('""one"" "two" \'three\' \\four'),
|
||||
['one', 'two', 'three', 'four'])
|
||||
|
||||
def test_strtobool(self):
|
||||
yes = ('y', 'Y', 'yes', 'True', 't', 'true', 'True', 'On', 'on', '1')
|
||||
|
|
@ -258,7 +258,7 @@ def test_rfc822_escape(self):
|
|||
res = rfc822_escape(header)
|
||||
wanted = ('I am a%(8s)spoor%(8s)slonesome%(8s)s'
|
||||
'header%(8s)s') % {'8s': '\n'+8*' '}
|
||||
self.assertEquals(res, wanted)
|
||||
self.assertEqual(res, wanted)
|
||||
|
||||
def test_dont_write_bytecode(self):
|
||||
# makes sure byte_compile raise a DistutilsError
|
||||
|
|
|
|||
|
|
@ -7,12 +7,12 @@ class VersionTestCase(unittest.TestCase):
|
|||
|
||||
def test_prerelease(self):
|
||||
version = StrictVersion('1.2.3a1')
|
||||
self.assertEquals(version.version, (1, 2, 3))
|
||||
self.assertEquals(version.prerelease, ('a', 1))
|
||||
self.assertEquals(str(version), '1.2.3a1')
|
||||
self.assertEqual(version.version, (1, 2, 3))
|
||||
self.assertEqual(version.prerelease, ('a', 1))
|
||||
self.assertEqual(str(version), '1.2.3a1')
|
||||
|
||||
version = StrictVersion('1.2.0')
|
||||
self.assertEquals(str(version), '1.2')
|
||||
self.assertEqual(str(version), '1.2')
|
||||
|
||||
def test_cmp_strict(self):
|
||||
versions = (('1.5.1', '1.5.2b2', -1),
|
||||
|
|
@ -41,9 +41,9 @@ def test_cmp_strict(self):
|
|||
raise AssertionError(("cmp(%s, %s) "
|
||||
"shouldn't raise ValueError")
|
||||
% (v1, v2))
|
||||
self.assertEquals(res, wanted,
|
||||
'cmp(%s, %s) should be %s, got %s' %
|
||||
(v1, v2, wanted, res))
|
||||
self.assertEqual(res, wanted,
|
||||
'cmp(%s, %s) should be %s, got %s' %
|
||||
(v1, v2, wanted, res))
|
||||
|
||||
|
||||
def test_cmp(self):
|
||||
|
|
@ -59,9 +59,9 @@ def test_cmp(self):
|
|||
|
||||
for v1, v2, wanted in versions:
|
||||
res = LooseVersion(v1)._cmp(LooseVersion(v2))
|
||||
self.assertEquals(res, wanted,
|
||||
'cmp(%s, %s) should be %s, got %s' %
|
||||
(v1, v2, wanted, res))
|
||||
self.assertEqual(res, wanted,
|
||||
'cmp(%s, %s) should be %s, got %s' %
|
||||
(v1, v2, wanted, res))
|
||||
|
||||
def test_suite():
|
||||
return unittest.makeSuite(VersionTestCase)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue