Replace deprecated fail* methods with the equivalent assert* ones.

This commit is contained in:
Ezio Melotti 2010-06-05 22:28:10 +00:00
parent 8dde20168a
commit 62c3c79426
1 changed files with 11 additions and 11 deletions

View File

@ -751,8 +751,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"',))
@ -771,10 +771,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',))
@ -794,11 +794,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():