summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_zipimport.py
diff options
context:
space:
mode:
authorEzio Melotti <ezio.melotti@gmail.com>2010-11-21 01:30:29 (GMT)
committerEzio Melotti <ezio.melotti@gmail.com>2010-11-21 01:30:29 (GMT)
commit19f2aeba67b5b4dc4dfd589d02d4a0b0804e22ee (patch)
tree596b5a2c45b058ea3e0cdc49cb7539a21410b98d /Lib/test/test_zipimport.py
parentb65b4937e20be4a2d3311326909c77bbf2e1c4cd (diff)
downloadcpython-19f2aeba67b5b4dc4dfd589d02d4a0b0804e22ee.zip
cpython-19f2aeba67b5b4dc4dfd589d02d4a0b0804e22ee.tar.gz
cpython-19f2aeba67b5b4dc4dfd589d02d4a0b0804e22ee.tar.bz2
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. ........
Diffstat (limited to 'Lib/test/test_zipimport.py')
-rw-r--r--Lib/test/test_zipimport.py54
1 files changed, 27 insertions, 27 deletions
diff --git a/Lib/test/test_zipimport.py b/Lib/test/test_zipimport.py
index 5d163c7..ebf6ad4 100644
--- a/Lib/test/test_zipimport.py
+++ b/Lib/test/test_zipimport.py
@@ -96,8 +96,8 @@ class UncompressedZipImportTestCase(ImportHooksBaseTestCase):
if expected_ext:
file = mod.get_file()
- self.assertEquals(file, os.path.join(TEMP_ZIP,
- *modules) + expected_ext)
+ self.assertEqual(file, os.path.join(TEMP_ZIP,
+ *modules) + expected_ext)
finally:
z.close()
os.remove(TEMP_ZIP)
@@ -209,31 +209,31 @@ class UncompressedZipImportTestCase(ImportHooksBaseTestCase):
z.close()
zi = zipimport.zipimporter(TEMP_ZIP)
- self.assertEquals(zi.archive, TEMP_ZIP)
- self.assertEquals(zi.is_package(TESTPACK), True)
+ self.assertEqual(zi.archive, TEMP_ZIP)
+ self.assertEqual(zi.is_package(TESTPACK), True)
mod = zi.load_module(TESTPACK)
- self.assertEquals(zi.get_filename(TESTPACK), mod.__file__)
+ self.assertEqual(zi.get_filename(TESTPACK), mod.__file__)
- self.assertEquals(zi.is_package(packdir + '__init__'), False)
- self.assertEquals(zi.is_package(packdir + TESTPACK2), True)
- self.assertEquals(zi.is_package(packdir2 + TESTMOD), False)
+ self.assertEqual(zi.is_package(packdir + '__init__'), False)
+ self.assertEqual(zi.is_package(packdir + TESTPACK2), True)
+ self.assertEqual(zi.is_package(packdir2 + TESTMOD), False)
mod_path = packdir2 + TESTMOD
mod_name = module_path_to_dotted_name(mod_path)
pkg = __import__(mod_name)
mod = sys.modules[mod_name]
- self.assertEquals(zi.get_source(TESTPACK), None)
- self.assertEquals(zi.get_source(mod_path), None)
- self.assertEquals(zi.get_filename(mod_path), mod.__file__)
+ self.assertEqual(zi.get_source(TESTPACK), None)
+ self.assertEqual(zi.get_source(mod_path), None)
+ self.assertEqual(zi.get_filename(mod_path), mod.__file__)
# To pass in the module name instead of the path, we must use the right importer
loader = mod.__loader__
- self.assertEquals(loader.get_source(mod_name), None)
- self.assertEquals(loader.get_filename(mod_name), mod.__file__)
+ self.assertEqual(loader.get_source(mod_name), None)
+ self.assertEqual(loader.get_filename(mod_name), mod.__file__)
# test prefix and archivepath members
zi2 = zipimport.zipimporter(TEMP_ZIP + os.sep + TESTPACK)
- self.assertEquals(zi2.archive, TEMP_ZIP)
- self.assertEquals(zi2.prefix, TESTPACK + os.sep)
+ self.assertEqual(zi2.archive, TEMP_ZIP)
+ self.assertEqual(zi2.prefix, TESTPACK + os.sep)
finally:
z.close()
os.remove(TEMP_ZIP)
@@ -253,26 +253,26 @@ class UncompressedZipImportTestCase(ImportHooksBaseTestCase):
z.close()
zi = zipimport.zipimporter(TEMP_ZIP + os.sep + packdir)
- self.assertEquals(zi.archive, TEMP_ZIP)
- self.assertEquals(zi.prefix, packdir)
- self.assertEquals(zi.is_package(TESTPACK2), True)
+ self.assertEqual(zi.archive, TEMP_ZIP)
+ self.assertEqual(zi.prefix, packdir)
+ self.assertEqual(zi.is_package(TESTPACK2), True)
mod = zi.load_module(TESTPACK2)
- self.assertEquals(zi.get_filename(TESTPACK2), mod.__file__)
+ self.assertEqual(zi.get_filename(TESTPACK2), mod.__file__)
- self.assertEquals(zi.is_package(TESTPACK2 + os.sep + '__init__'), False)
- self.assertEquals(zi.is_package(TESTPACK2 + os.sep + TESTMOD), False)
+ self.assertEqual(zi.is_package(TESTPACK2 + os.sep + '__init__'), False)
+ self.assertEqual(zi.is_package(TESTPACK2 + os.sep + TESTMOD), False)
mod_path = TESTPACK2 + os.sep + TESTMOD
mod_name = module_path_to_dotted_name(mod_path)
pkg = __import__(mod_name)
mod = sys.modules[mod_name]
- self.assertEquals(zi.get_source(TESTPACK2), None)
- self.assertEquals(zi.get_source(mod_path), None)
- self.assertEquals(zi.get_filename(mod_path), mod.__file__)
+ self.assertEqual(zi.get_source(TESTPACK2), None)
+ self.assertEqual(zi.get_source(mod_path), None)
+ self.assertEqual(zi.get_filename(mod_path), mod.__file__)
# To pass in the module name instead of the path, we must use the right importer
loader = mod.__loader__
- self.assertEquals(loader.get_source(mod_name), None)
- self.assertEquals(loader.get_filename(mod_name), mod.__file__)
+ self.assertEqual(loader.get_source(mod_name), None)
+ self.assertEqual(loader.get_filename(mod_name), mod.__file__)
finally:
z.close()
os.remove(TEMP_ZIP)
@@ -286,7 +286,7 @@ class UncompressedZipImportTestCase(ImportHooksBaseTestCase):
z.writestr(name, data)
z.close()
zi = zipimport.zipimporter(TEMP_ZIP)
- self.assertEquals(data, zi.get_data(name))
+ self.assertEqual(data, zi.get_data(name))
self.assertTrue('zipimporter object' in repr(zi))
finally:
z.close()