summaryrefslogtreecommitdiff
path: root/Lib/test/test_posixpath.py
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2009-06-30 23:06:06 +0000
committerBenjamin Peterson <benjamin@python.org>2009-06-30 23:06:06 +0000
commitdeba941d61c8f02f84a5d1452f568d7dbf4d85e3 (patch)
treebb698d1f561a00998342883e2c1b3e405a6438aa /Lib/test/test_posixpath.py
parent5eefe5bea1d72e42ef82ee8d60c33187e43d958c (diff)
downloadcpython-deba941d61c8f02f84a5d1452f568d7dbf4d85e3.tar.gz
convert old fail* assertions to assert*
Diffstat (limited to 'Lib/test/test_posixpath.py')
-rw-r--r--Lib/test/test_posixpath.py28
1 files changed, 14 insertions, 14 deletions
diff --git a/Lib/test/test_posixpath.py b/Lib/test/test_posixpath.py
index eb918f4976..0efe3ff656 100644
--- a/Lib/test/test_posixpath.py
+++ b/Lib/test/test_posixpath.py
@@ -26,7 +26,7 @@ class PosixPathTest(unittest.TestCase):
safe_rmdir(support.TESTFN + suffix)
def assertIs(self, a, b):
- self.assert_(a is b)
+ self.assertTrue(a is b)
def test_normcase(self):
# Check that normcase() is idempotent
@@ -200,8 +200,8 @@ class PosixPathTest(unittest.TestCase):
for s1 in testlist:
for s2 in testlist:
p = posixpath.commonprefix([s1, s2])
- self.assert_(s1.startswith(p))
- self.assert_(s2.startswith(p))
+ self.assertTrue(s1.startswith(p))
+ self.assertTrue(s2.startswith(p))
if s1 != s2:
n = len(p)
self.assertNotEqual(s1[n:n+1], s2[n:n+1])
@@ -229,7 +229,7 @@ class PosixPathTest(unittest.TestCase):
f.close()
self.assertEqual(d, b"foobar")
- self.assert_(
+ self.assertTrue(
posixpath.getctime(support.TESTFN) <=
posixpath.getmtime(support.TESTFN)
)
@@ -402,8 +402,8 @@ class PosixPathTest(unittest.TestCase):
except ImportError:
pass
else:
- self.assert_(isinstance(posixpath.expanduser("~/"), str))
- self.assert_(isinstance(posixpath.expanduser(b"~/"), bytes))
+ self.assertTrue(isinstance(posixpath.expanduser("~/"), str))
+ self.assertTrue(isinstance(posixpath.expanduser(b"~/"), bytes))
# if home directory == root directory, this test makes no sense
if posixpath.expanduser("~") != '/':
self.assertEqual(
@@ -414,10 +414,10 @@ class PosixPathTest(unittest.TestCase):
posixpath.expanduser(b"~") + b"/",
posixpath.expanduser(b"~/")
)
- self.assert_(isinstance(posixpath.expanduser("~root/"), str))
- self.assert_(isinstance(posixpath.expanduser("~foo/"), str))
- self.assert_(isinstance(posixpath.expanduser(b"~root/"), bytes))
- self.assert_(isinstance(posixpath.expanduser(b"~foo/"), bytes))
+ self.assertTrue(isinstance(posixpath.expanduser("~root/"), str))
+ self.assertTrue(isinstance(posixpath.expanduser("~foo/"), str))
+ self.assertTrue(isinstance(posixpath.expanduser(b"~root/"), bytes))
+ self.assertTrue(isinstance(posixpath.expanduser(b"~foo/"), bytes))
with support.EnvironmentVarGuard() as env:
env['HOME'] = '/'
@@ -481,14 +481,14 @@ class PosixPathTest(unittest.TestCase):
self.assertRaises(TypeError, posixpath.normpath)
def test_abspath(self):
- self.assert_("foo" in posixpath.abspath("foo"))
- self.assert_(b"foo" in posixpath.abspath(b"foo"))
+ self.assertTrue("foo" in posixpath.abspath("foo"))
+ self.assertTrue(b"foo" in posixpath.abspath(b"foo"))
self.assertRaises(TypeError, posixpath.abspath)
def test_realpath(self):
- self.assert_("foo" in realpath("foo"))
- self.assert_(b"foo" in realpath(b"foo"))
+ self.assertTrue("foo" in realpath("foo"))
+ self.assertTrue(b"foo" in realpath(b"foo"))
self.assertRaises(TypeError, posixpath.realpath)
if hasattr(os, "symlink"):