mirror of https://github.com/python/cpython
Replace deprecated fail* methods with the equivalent assert* ones.
This commit is contained in:
parent
8dde20168a
commit
62c3c79426
|
@ -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():
|
||||
|
|
Loading…
Reference in New Issue