Merged revisions 81769 via svnmerge from

svn+ssh://pythondev@svn.python.org/python/trunk

........
  r81769 | ezio.melotti | 2010-06-06 01:28:10 +0300 (Sun, 06 Jun 2010) | 1 line

  Replace deprecated fail* methods with the equivalent assert* ones.
........
This commit is contained in:
Ezio Melotti 2010-06-07 21:53:10 +00:00
parent f7a65490a4
commit ac85eeb1f0
1 changed files with 11 additions and 11 deletions

View File

@ -422,8 +422,8 @@ class TestCopyFile(unittest.TestCase):
self._set_shutil_open(_open)
shutil.copyfile('srcfile', 'destfile')
self.failUnless(srcfile._entered)
self.failUnless(srcfile._exited_with[0] is IOError)
self.assertTrue(srcfile._entered)
self.assertTrue(srcfile._exited_with[0] is IOError)
self.assertEqual(srcfile._exited_with[1].args,
('Cannot open "destfile"',))
@ -442,10 +442,10 @@ class TestCopyFile(unittest.TestCase):
self._set_shutil_open(_open)
shutil.copyfile('srcfile', 'destfile')
self.failUnless(srcfile._entered)
self.failUnless(destfile._entered)
self.failUnless(destfile._raised)
self.failUnless(srcfile._exited_with[0] is IOError)
self.assertTrue(srcfile._entered)
self.assertTrue(destfile._entered)
self.assertTrue(destfile._raised)
self.assertTrue(srcfile._exited_with[0] is IOError)
self.assertEqual(srcfile._exited_with[1].args,
('Cannot close',))
@ -465,11 +465,11 @@ class TestCopyFile(unittest.TestCase):
self.assertRaises(IOError,
shutil.copyfile, 'srcfile', 'destfile')
self.failUnless(srcfile._entered)
self.failUnless(destfile._entered)
self.failIf(destfile._raised)
self.failUnless(srcfile._exited_with[0] is None)
self.failUnless(srcfile._raised)
self.assertTrue(srcfile._entered)
self.assertTrue(destfile._entered)
self.assertFalse(destfile._raised)
self.assertTrue(srcfile._exited_with[0] is None)
self.assertTrue(srcfile._raised)
def test_main():