summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_os.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2009-08-13 08:51:18 (GMT)
committerGeorg Brandl <georg@python.org>2009-08-13 08:51:18 (GMT)
commitab91fdef1f1e556203a2eee98ba7d379e4790de9 (patch)
tree6f8f00dc18cc5f2801a675df277c2c595eb85ec8 /Lib/test/test_os.py
parentef82be368abdea8e8032500e7ecc3a22f5f07851 (diff)
downloadcpython-ab91fdef1f1e556203a2eee98ba7d379e4790de9.zip
cpython-ab91fdef1f1e556203a2eee98ba7d379e4790de9.tar.gz
cpython-ab91fdef1f1e556203a2eee98ba7d379e4790de9.tar.bz2
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* ........
Diffstat (limited to 'Lib/test/test_os.py')
-rw-r--r--Lib/test/test_os.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py
index 9e60f00..62edd6c 100644
--- a/Lib/test/test_os.py
+++ b/Lib/test/test_os.py
@@ -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',