summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_zipimport.py
diff options
context:
space:
mode:
authorEzio Melotti <ezio.melotti@gmail.com>2010-11-20 19:04:17 (GMT)
committerEzio Melotti <ezio.melotti@gmail.com>2010-11-20 19:04:17 (GMT)
commitb3aedd48621ed9d33b5f42f946b256bce4a50673 (patch)
tree2297c8ebce1b09621e1d98096c1603896d9a0f0c /Lib/test/test_zipimport.py
parentb8bc439b2093add9b313bcca2cc507a2d0e87764 (diff)
downloadcpython-b3aedd48621ed9d33b5f42f946b256bce4a50673.zip
cpython-b3aedd48621ed9d33b5f42f946b256bce4a50673.tar.gz
cpython-b3aedd48621ed9d33b5f42f946b256bce4a50673.tar.bz2
#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 838e1b5..090f0f3 100644
--- a/Lib/test/test_zipimport.py
+++ b/Lib/test/test_zipimport.py
@@ -97,8 +97,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)
@@ -211,32 +211,32 @@ 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)
__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)
@@ -256,29 +256,29 @@ 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(
+ self.assertEqual(
zi.is_package(TESTPACK2 + os.sep + '__init__'), False)
- self.assertEquals(
+ 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)
__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)
@@ -292,7 +292,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.assertIn('zipimporter object', repr(zi))
finally:
z.close()