summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_shutil.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_shutil.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_shutil.py')
-rw-r--r--Lib/test/test_shutil.py24
1 files changed, 12 insertions, 12 deletions
diff --git a/Lib/test/test_shutil.py b/Lib/test/test_shutil.py
index 5a546ec..60352a2 100644
--- a/Lib/test/test_shutil.py
+++ b/Lib/test/test_shutil.py
@@ -63,12 +63,12 @@ class TestShutil(unittest.TestCase):
self.assertIs(func, os.listdir,
"func must be either os.remove or os.listdir")
self.assertEqual(arg, TESTFN)
- self.failUnless(issubclass(exc[0], OSError))
+ self.assertTrue(issubclass(exc[0], OSError))
self.errorState = 1
else:
self.assertEqual(func, os.rmdir)
self.assertEqual(arg, TESTFN)
- self.failUnless(issubclass(exc[0], OSError))
+ self.assertTrue(issubclass(exc[0], OSError))
self.errorState = 2
def test_rmtree_dont_delete_file(self):
@@ -158,9 +158,9 @@ class TestShutil(unittest.TestCase):
patterns = shutil.ignore_patterns('*.tmp', 'test_dir2')
shutil.copytree(src_dir, dst_dir, ignore=patterns)
# checking the result: some elements should not be copied
- self.assert_(exists(join(dst_dir, 'test.txt')))
- self.assert_(not exists(join(dst_dir, 'test.tmp')))
- self.assert_(not exists(join(dst_dir, 'test_dir2')))
+ self.assertTrue(exists(join(dst_dir, 'test.txt')))
+ self.assertTrue(not exists(join(dst_dir, 'test.tmp')))
+ self.assertTrue(not exists(join(dst_dir, 'test_dir2')))
finally:
if os.path.exists(dst_dir):
shutil.rmtree(dst_dir)
@@ -168,9 +168,9 @@ class TestShutil(unittest.TestCase):
patterns = shutil.ignore_patterns('*.tmp', 'subdir*')
shutil.copytree(src_dir, dst_dir, ignore=patterns)
# checking the result: some elements should not be copied
- self.assert_(not exists(join(dst_dir, 'test.tmp')))
- self.assert_(not exists(join(dst_dir, 'test_dir2', 'subdir2')))
- self.assert_(not exists(join(dst_dir, 'test_dir2', 'subdir')))
+ self.assertTrue(not exists(join(dst_dir, 'test.tmp')))
+ self.assertTrue(not exists(join(dst_dir, 'test_dir2', 'subdir2')))
+ self.assertTrue(not exists(join(dst_dir, 'test_dir2', 'subdir')))
finally:
if os.path.exists(dst_dir):
shutil.rmtree(dst_dir)
@@ -192,9 +192,9 @@ class TestShutil(unittest.TestCase):
shutil.copytree(src_dir, dst_dir, ignore=_filter)
# checking the result: some elements should not be copied
- self.assert_(not exists(join(dst_dir, 'test_dir2', 'subdir2',
+ self.assertTrue(not exists(join(dst_dir, 'test_dir2', 'subdir2',
'test.py')))
- self.assert_(not exists(join(dst_dir, 'test_dir2', 'subdir')))
+ self.assertTrue(not exists(join(dst_dir, 'test_dir2', 'subdir')))
finally:
if os.path.exists(dst_dir):
@@ -393,7 +393,7 @@ class TestMove(unittest.TestCase):
for src, dst in [('srcdir', 'srcdir/dest')]:
src = os.path.join(TESTFN, src)
dst = os.path.join(TESTFN, dst)
- self.assert_(shutil._destinsrc(src, dst),
+ self.assertTrue(shutil._destinsrc(src, dst),
msg='_destinsrc() wrongly concluded that '
'dst (%s) is not in src (%s)' % (dst, src))
finally:
@@ -405,7 +405,7 @@ class TestMove(unittest.TestCase):
for src, dst in [('srcdir', 'src/dest'), ('srcdir', 'srcdir.new')]:
src = os.path.join(TESTFN, src)
dst = os.path.join(TESTFN, dst)
- self.failIf(shutil._destinsrc(src, dst),
+ self.assertFalse(shutil._destinsrc(src, dst),
msg='_destinsrc() wrongly concluded that '
'dst (%s) is in src (%s)' % (dst, src))
finally: