diff options
Diffstat (limited to 'Lib/test/test_filecmp.py')
-rw-r--r-- | Lib/test/test_filecmp.py | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/Lib/test/test_filecmp.py b/Lib/test/test_filecmp.py index 22f0be7..c71a27a 100644 --- a/Lib/test/test_filecmp.py +++ b/Lib/test/test_filecmp.py @@ -25,19 +25,19 @@ class FileCompareTestCase(unittest.TestCase): os.unlink(self.name_diff) def test_matching(self): - self.failUnless(filecmp.cmp(self.name, self.name_same), + self.assertTrue(filecmp.cmp(self.name, self.name_same), "Comparing file to itself fails") - self.failUnless(filecmp.cmp(self.name, self.name_same, shallow=False), + self.assertTrue(filecmp.cmp(self.name, self.name_same, shallow=False), "Comparing file to itself fails") - self.failUnless(filecmp.cmp(self.name, self.name, shallow=False), + self.assertTrue(filecmp.cmp(self.name, self.name, shallow=False), "Comparing file to identical file fails") - self.failUnless(filecmp.cmp(self.name, self.name), + self.assertTrue(filecmp.cmp(self.name, self.name), "Comparing file to identical file fails") def test_different(self): - self.failIf(filecmp.cmp(self.name, self.name_diff), + self.assertFalse(filecmp.cmp(self.name, self.name_diff), "Mismatched files compare as equal") - self.failIf(filecmp.cmp(self.name, self.dir), + self.assertFalse(filecmp.cmp(self.name, self.dir), "File and directory compare as equal") class DirCompareTestCase(unittest.TestCase): @@ -69,19 +69,19 @@ class DirCompareTestCase(unittest.TestCase): shutil.rmtree(self.dir_diff) def test_cmpfiles(self): - self.failUnless(filecmp.cmpfiles(self.dir, self.dir, ['file']) == + self.assertTrue(filecmp.cmpfiles(self.dir, self.dir, ['file']) == (['file'], [], []), "Comparing directory to itself fails") - self.failUnless(filecmp.cmpfiles(self.dir, self.dir_same, ['file']) == + self.assertTrue(filecmp.cmpfiles(self.dir, self.dir_same, ['file']) == (['file'], [], []), "Comparing directory to same fails") # Try it with shallow=False - self.failUnless(filecmp.cmpfiles(self.dir, self.dir, ['file'], + self.assertTrue(filecmp.cmpfiles(self.dir, self.dir, ['file'], shallow=False) == (['file'], [], []), "Comparing directory to itself fails") - self.failUnless(filecmp.cmpfiles(self.dir, self.dir_same, ['file'], + self.assertTrue(filecmp.cmpfiles(self.dir, self.dir_same, ['file'], shallow=False), "Comparing directory to same fails") @@ -90,7 +90,7 @@ class DirCompareTestCase(unittest.TestCase): output.write('Different contents.\n') output.close() - self.failIf(filecmp.cmpfiles(self.dir, self.dir_same, + self.assertFalse(filecmp.cmpfiles(self.dir, self.dir_same, ['file', 'file2']) == (['file'], ['file2'], []), "Comparing mismatched directories fails") @@ -104,14 +104,14 @@ class DirCompareTestCase(unittest.TestCase): else: self.assertEqual([d.left_list, d.right_list],[['file'], ['file']]) self.assertEqual(d.common, ['file']) - self.failUnless(d.left_only == d.right_only == []) + self.assertTrue(d.left_only == d.right_only == []) self.assertEqual(d.same_files, ['file']) self.assertEqual(d.diff_files, []) # Check attributes for comparison of two different directories d = filecmp.dircmp(self.dir, self.dir_diff) self.assertEqual(d.left_list, ['file']) - self.failUnless(d.right_list == ['file', 'file2']) + self.assertTrue(d.right_list == ['file', 'file2']) self.assertEqual(d.common, ['file']) self.assertEqual(d.left_only, []) self.assertEqual(d.right_only, ['file2']) |