diff options
author | Raymond Hettinger <python@rcn.com> | 2003-09-02 06:59:21 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2003-09-02 06:59:21 (GMT) |
commit | f70e0760420314fec01c6001dac169c836aeca3f (patch) | |
tree | 23b1f2a19f256495626e364611a0a5ad2895049b /Lib/test/test_filecmp.py | |
parent | eeca37e0b5a86bc8113f9f51cace145a71c56dd4 (diff) | |
download | cpython-f70e0760420314fec01c6001dac169c836aeca3f.zip cpython-f70e0760420314fec01c6001dac169c836aeca3f.tar.gz cpython-f70e0760420314fec01c6001dac169c836aeca3f.tar.bz2 |
Only apply case-insensitivity test on appropriate platforms.' test_filecmp.py
Diffstat (limited to 'Lib/test/test_filecmp.py')
-rw-r--r-- | Lib/test/test_filecmp.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Lib/test/test_filecmp.py b/Lib/test/test_filecmp.py index b433ecc..c54119c 100644 --- a/Lib/test/test_filecmp.py +++ b/Lib/test/test_filecmp.py @@ -46,10 +46,11 @@ class DirCompareTestCase(unittest.TestCase): 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 @@ class DirCompareTestCase(unittest.TestCase): 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']) |