Merged revisions 73715 via svnmerge from

svn+ssh://svn.python.org/python/branches/py3k

........
  r73715 | benjamin.peterson | 2009-07-01 01:06:06 +0200 (Mi, 01 Jul 2009) | 1 line

  convert old fail* assertions to assert*
........
This commit is contained in:
Georg Brandl 2009-08-13 08:51:18 +00:00
parent ef82be368a
commit ab91fdef1f
274 changed files with 4538 additions and 4538 deletions

View file

@ -20,7 +20,7 @@ class FileTests(unittest.TestCase):
def test_access(self):
f = os.open(support.TESTFN, os.O_CREAT|os.O_RDWR)
os.close(f)
self.assert_(os.access(support.TESTFN, os.W_OK))
self.assertTrue(os.access(support.TESTFN, os.W_OK))
def test_closerange(self):
first = os.open(support.TESTFN, os.O_CREAT|os.O_RDWR)
@ -85,7 +85,7 @@ class TemporaryFileTests(unittest.TestCase):
def check_tempfile(self, name):
# make sure it doesn't already exist:
self.failIf(os.path.exists(name),
self.assertFalse(os.path.exists(name),
"file already exists for temporary file")
# make sure we can create the file
open(name, "w")
@ -102,7 +102,7 @@ class TemporaryFileTests(unittest.TestCase):
self.check_tempfile(name)
name = os.tempnam(support.TESTFN, "pfx")
self.assert_(os.path.basename(name)[:3] == "pfx")
self.assertTrue(os.path.basename(name)[:3] == "pfx")
self.check_tempfile(name)
def test_tmpfile(self):
@ -151,7 +151,7 @@ class TemporaryFileTests(unittest.TestCase):
fp.seek(0,0)
s = fp.read()
fp.close()
self.assert_(s == "foobar")
self.assertTrue(s == "foobar")
def test_tmpnam(self):
import sys
@ -176,7 +176,7 @@ class TemporaryFileTests(unittest.TestCase):
# the root of the current drive. That's a terrible place to
# put temp files, and, depending on privileges, the user
# may not even be able to open a file in the root directory.
self.failIf(os.path.exists(name),
self.assertFalse(os.path.exists(name),
"file already exists for temporary file")
else:
self.check_tempfile(name)
@ -228,7 +228,7 @@ class StatAttributeTests(unittest.TestCase):
def trunc(x): return x
self.assertEquals(trunc(getattr(result, attr)),
result[getattr(stat, name)])
self.assert_(attr in members)
self.assertTrue(attr in members)
try:
result[200]
@ -520,7 +520,7 @@ class MakedirTests(unittest.TestCase):
os.makedirs(path)
# Try paths with a '.' in them
self.failUnlessRaises(OSError, os.makedirs, os.curdir)
self.assertRaises(OSError, os.makedirs, os.curdir)
path = os.path.join(base, 'dir1', 'dir2', 'dir3', 'dir4', 'dir5', os.curdir)
os.makedirs(path)
path = os.path.join(base, 'dir1', os.curdir, 'dir2', 'dir3', 'dir4',