diff options
author | Ezio Melotti <ezio.melotti@gmail.com> | 2010-11-20 19:04:17 (GMT) |
---|---|---|
committer | Ezio Melotti <ezio.melotti@gmail.com> | 2010-11-20 19:04:17 (GMT) |
commit | b3aedd48621ed9d33b5f42f946b256bce4a50673 (patch) | |
tree | 2297c8ebce1b09621e1d98096c1603896d9a0f0c /Lib/test/test_winreg.py | |
parent | b8bc439b2093add9b313bcca2cc507a2d0e87764 (diff) | |
download | cpython-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_winreg.py')
-rw-r--r-- | Lib/test/test_winreg.py | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/Lib/test/test_winreg.py b/Lib/test/test_winreg.py index b4524db..b6b23c8 100644 --- a/Lib/test/test_winreg.py +++ b/Lib/test/test_winreg.py @@ -82,12 +82,12 @@ class BaseWinregTests(unittest.TestCase): # Check we wrote as many items as we thought. nkeys, nvalues, since_mod = QueryInfoKey(key) - self.assertEquals(nkeys, 1, "Not the correct number of sub keys") - self.assertEquals(nvalues, 1, "Not the correct number of values") + self.assertEqual(nkeys, 1, "Not the correct number of sub keys") + self.assertEqual(nvalues, 1, "Not the correct number of values") nkeys, nvalues, since_mod = QueryInfoKey(sub_key) - self.assertEquals(nkeys, 0, "Not the correct number of sub keys") - self.assertEquals(nvalues, len(test_data), - "Not the correct number of values") + self.assertEqual(nkeys, 0, "Not the correct number of sub keys") + self.assertEqual(nvalues, len(test_data), + "Not the correct number of values") # Close this key this way... # (but before we do, copy the key as an integer - this allows # us to test that the key really gets closed). @@ -112,8 +112,8 @@ class BaseWinregTests(unittest.TestCase): def _read_test_data(self, root_key, subkeystr="sub_key", OpenKey=OpenKey): # Check we can get default value for this key. val = QueryValue(root_key, test_key_name) - self.assertEquals(val, "Default value", - "Registry didn't give back the correct value") + self.assertEqual(val, "Default value", + "Registry didn't give back the correct value") key = OpenKey(root_key, test_key_name) # Read the sub-keys @@ -125,22 +125,22 @@ class BaseWinregTests(unittest.TestCase): data = EnumValue(sub_key, index) except EnvironmentError: break - self.assertEquals(data in test_data, True, - "Didn't read back the correct test data") + self.assertEqual(data in test_data, True, + "Didn't read back the correct test data") index = index + 1 - self.assertEquals(index, len(test_data), - "Didn't read the correct number of items") + self.assertEqual(index, len(test_data), + "Didn't read the correct number of items") # Check I can directly access each item for value_name, value_data, value_type in test_data: read_val, read_typ = QueryValueEx(sub_key, value_name) - self.assertEquals(read_val, value_data, - "Could not directly read the value") - self.assertEquals(read_typ, value_type, - "Could not directly read the value") + self.assertEqual(read_val, value_data, + "Could not directly read the value") + self.assertEqual(read_typ, value_type, + "Could not directly read the value") sub_key.Close() # Enumerate our main key. read_val = EnumKey(key, 0) - self.assertEquals(read_val, subkeystr, "Read subkey value wrong") + self.assertEqual(read_val, subkeystr, "Read subkey value wrong") try: EnumKey(key, 1) self.fail("Was able to get a second key when I only have one!") @@ -159,8 +159,8 @@ class BaseWinregTests(unittest.TestCase): DeleteValue(sub_key, value_name) nkeys, nvalues, since_mod = QueryInfoKey(sub_key) - self.assertEquals(nkeys, 0, "subkey not empty before delete") - self.assertEquals(nvalues, 0, "subkey not empty before delete") + self.assertEqual(nkeys, 0, "subkey not empty before delete") + self.assertEqual(nvalues, 0, "subkey not empty before delete") sub_key.Close() DeleteKey(key, subkeystr) @@ -341,8 +341,8 @@ class Win64WinregTests(BaseWinregTests): with OpenKey(HKEY_LOCAL_MACHINE, "Software") as key: # HKLM\Software is redirected but not reflected in all OSes self.assertTrue(QueryReflectionKey(key)) - self.assertEquals(None, EnableReflectionKey(key)) - self.assertEquals(None, DisableReflectionKey(key)) + self.assertEqual(None, EnableReflectionKey(key)) + self.assertEqual(None, DisableReflectionKey(key)) self.assertTrue(QueryReflectionKey(key)) @unittest.skipUnless(HAS_REFLECTION, "OS doesn't support reflection") |