Commit 62c3c794 authored by Ezio Melotti's avatar Ezio Melotti

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

parent 8dde2016
...@@ -751,8 +751,8 @@ class TestCopyFile(unittest.TestCase): ...@@ -751,8 +751,8 @@ class TestCopyFile(unittest.TestCase):
self._set_shutil_open(_open) self._set_shutil_open(_open)
shutil.copyfile('srcfile', 'destfile') shutil.copyfile('srcfile', 'destfile')
self.failUnless(srcfile._entered) self.assertTrue(srcfile._entered)
self.failUnless(srcfile._exited_with[0] is IOError) self.assertTrue(srcfile._exited_with[0] is IOError)
self.assertEqual(srcfile._exited_with[1].args, self.assertEqual(srcfile._exited_with[1].args,
('Cannot open "destfile"',)) ('Cannot open "destfile"',))
...@@ -771,10 +771,10 @@ class TestCopyFile(unittest.TestCase): ...@@ -771,10 +771,10 @@ class TestCopyFile(unittest.TestCase):
self._set_shutil_open(_open) self._set_shutil_open(_open)
shutil.copyfile('srcfile', 'destfile') shutil.copyfile('srcfile', 'destfile')
self.failUnless(srcfile._entered) self.assertTrue(srcfile._entered)
self.failUnless(destfile._entered) self.assertTrue(destfile._entered)
self.failUnless(destfile._raised) self.assertTrue(destfile._raised)
self.failUnless(srcfile._exited_with[0] is IOError) self.assertTrue(srcfile._exited_with[0] is IOError)
self.assertEqual(srcfile._exited_with[1].args, self.assertEqual(srcfile._exited_with[1].args,
('Cannot close',)) ('Cannot close',))
...@@ -794,11 +794,11 @@ class TestCopyFile(unittest.TestCase): ...@@ -794,11 +794,11 @@ class TestCopyFile(unittest.TestCase):
self.assertRaises(IOError, self.assertRaises(IOError,
shutil.copyfile, 'srcfile', 'destfile') shutil.copyfile, 'srcfile', 'destfile')
self.failUnless(srcfile._entered) self.assertTrue(srcfile._entered)
self.failUnless(destfile._entered) self.assertTrue(destfile._entered)
self.failIf(destfile._raised) self.assertFalse(destfile._raised)
self.failUnless(srcfile._exited_with[0] is None) self.assertTrue(srcfile._exited_with[0] is None)
self.failUnless(srcfile._raised) self.assertTrue(srcfile._raised)
def test_main(): def test_main():
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment