diff options
author | Ezio Melotti <ezio.melotti@gmail.com> | 2010-11-21 01:30:29 (GMT) |
---|---|---|
committer | Ezio Melotti <ezio.melotti@gmail.com> | 2010-11-21 01:30:29 (GMT) |
commit | 19f2aeba67b5b4dc4dfd589d02d4a0b0804e22ee (patch) | |
tree | 596b5a2c45b058ea3e0cdc49cb7539a21410b98d /Lib/test/test_os.py | |
parent | b65b4937e20be4a2d3311326909c77bbf2e1c4cd (diff) | |
download | cpython-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_os.py')
-rw-r--r-- | Lib/test/test_os.py | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py index 9be1aad..d30c45d 100644 --- a/Lib/test/test_os.py +++ b/Lib/test/test_os.py @@ -223,8 +223,8 @@ class StatAttributeTests(unittest.TestCase): result = os.stat(self.fname) # Make sure direct access works - self.assertEquals(result[stat.ST_SIZE], 3) - self.assertEquals(result.st_size, 3) + self.assertEqual(result[stat.ST_SIZE], 3) + self.assertEqual(result.st_size, 3) import sys @@ -237,8 +237,8 @@ class StatAttributeTests(unittest.TestCase): def trunc(x): return int(x) else: def trunc(x): return x - self.assertEquals(trunc(getattr(result, attr)), - result[getattr(stat, name)]) + self.assertEqual(trunc(getattr(result, attr)), + result[getattr(stat, name)]) self.assertTrue(attr in members) try: @@ -292,13 +292,13 @@ class StatAttributeTests(unittest.TestCase): return # Make sure direct access works - self.assertEquals(result.f_bfree, result[3]) + self.assertEqual(result.f_bfree, result[3]) # Make sure all the attributes are there. members = ('bsize', 'frsize', 'blocks', 'bfree', 'bavail', 'files', 'ffree', 'favail', 'flag', 'namemax') for value, member in enumerate(members): - self.assertEquals(getattr(result, 'f_' + member), result[value]) + self.assertEqual(getattr(result, 'f_' + member), result[value]) # Make sure that assignment really fails try: @@ -333,7 +333,7 @@ class StatAttributeTests(unittest.TestCase): # time stamps in stat, but not in utime. os.utime(support.TESTFN, (st.st_atime, int(st.st_mtime-delta))) st2 = os.stat(support.TESTFN) - self.assertEquals(st2.st_mtime, int(st.st_mtime-delta)) + self.assertEqual(st2.st_mtime, int(st.st_mtime-delta)) # Restrict test to Win32, since there is no guarantee other # systems support centiseconds @@ -350,7 +350,7 @@ class StatAttributeTests(unittest.TestCase): def test_1565150(self): t1 = 1159195039.25 os.utime(self.fname, (t1, t1)) - self.assertEquals(os.stat(self.fname).st_mtime, t1) + self.assertEqual(os.stat(self.fname).st_mtime, t1) def test_1686475(self): # Verify that an open file can be stat'ed @@ -390,24 +390,24 @@ class EnvironTests(mapping_tests.BasicTestMappingProtocol): os.environ.update(HELLO="World") with os.popen("/bin/sh -c 'echo $HELLO'") as popen: value = popen.read().strip() - self.assertEquals(value, "World") + self.assertEqual(value, "World") def test_os_popen_iter(self): if os.path.exists("/bin/sh"): with os.popen( "/bin/sh -c 'echo \"line1\nline2\nline3\"'") as popen: it = iter(popen) - self.assertEquals(next(it), "line1\n") - self.assertEquals(next(it), "line2\n") - self.assertEquals(next(it), "line3\n") + self.assertEqual(next(it), "line1\n") + self.assertEqual(next(it), "line2\n") + self.assertEqual(next(it), "line3\n") self.assertRaises(StopIteration, next, it) # Verify environ keys and values from the OS are of the # correct str type. def test_keyvalue_types(self): for key, val in os.environ.items(): - self.assertEquals(type(key), str) - self.assertEquals(type(val), str) + self.assertEqual(type(key), str) + self.assertEqual(type(val), str) def test_items(self): for key, value in self._reference().items(): @@ -780,7 +780,7 @@ if sys.platform != 'win32': def test_listdir(self): expected = set(self.unicodefn) found = set(os.listdir(support.TESTFN)) - self.assertEquals(found, expected) + self.assertEqual(found, expected) def test_open(self): for fn in self.unicodefn: |