From f70e0760420314fec01c6001dac169c836aeca3f Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Tue, 2 Sep 2003 06:59:21 +0000 Subject: [PATCH] Only apply case-insensitivity test on appropriate platforms.' test_filecmp.py --- Lib/test/test_filecmp.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Lib/test/test_filecmp.py b/Lib/test/test_filecmp.py index b433ecc9ef1..c54119c2979 100644 --- a/Lib/test/test_filecmp.py +++ b/Lib/test/test_filecmp.py @@ -46,10 +46,11 @@ def setUp(self): self.dir = os.path.join(tmpdir, 'dir') self.dir_same = os.path.join(tmpdir, 'dir-same') self.dir_diff = os.path.join(tmpdir, 'dir-diff') + self.caseinsensitive = os.path.normcase('A') == os.path.normcase('a') data = 'Contents of file go here.\n' for dir in [self.dir, self.dir_same, self.dir_diff]: os.mkdir(dir) - if dir is self.dir_same: + if self.caseinsensitive and dir is self.dir_same: fn = 'FiLe' # Verify case-insensitive comparison else: fn = 'file' @@ -97,7 +98,10 @@ def test_cmpfiles(self): def test_dircmp(self): # Check attributes for comparison of two identical directories d = filecmp.dircmp(self.dir, self.dir_same) - self.assertEqual([d.left_list, d.right_list],[['file'], ['FiLe']]) + if self.caseinsensitive: + self.assertEqual([d.left_list, d.right_list],[['file'], ['FiLe']]) + else: + self.assertEqual([d.left_list, d.right_list],[['file'], ['file']]) self.failUnless(d.common == ['file']) self.failUnless(d.left_only == d.right_only == []) self.failUnless(d.same_files == ['file'])