diff options
author | Ronald Oussoren <ronaldoussoren@mac.com> | 2011-05-06 08:57:22 (GMT) |
---|---|---|
committer | Ronald Oussoren <ronaldoussoren@mac.com> | 2011-05-06 08:57:22 (GMT) |
commit | 78349b06af6cabe7ff949a98fafa15d8a9c48c61 (patch) | |
tree | 5b5006f315051a971e137c32285164a858fe3f13 /Lib/test | |
parent | 8cd2e5f7512424354d2b3a05115d906d2def237a (diff) | |
parent | f51738b10e83d0adf404ca989970a5b44700d685 (diff) | |
download | cpython-78349b06af6cabe7ff949a98fafa15d8a9c48c61.zip cpython-78349b06af6cabe7ff949a98fafa15d8a9c48c61.tar.gz cpython-78349b06af6cabe7ff949a98fafa15d8a9c48c61.tar.bz2 |
merge from 3.1
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_shutil.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/Lib/test/test_shutil.py b/Lib/test/test_shutil.py index 5252d4d..475a26b 100644 --- a/Lib/test/test_shutil.py +++ b/Lib/test/test_shutil.py @@ -951,6 +951,24 @@ class TestCopyFile(unittest.TestCase): self.assertTrue(srcfile._exited_with[0] is None) self.assertTrue(srcfile._raised) + def test_move_dir_caseinsensitive(self): + # Renames a folder to the same name + # but a different case. + + self.src_dir = tempfile.mkdtemp() + dst_dir = os.path.join( + os.path.dirname(self.src_dir), + os.path.basename(self.src_dir).upper()) + self.assertNotEqual(self.src_dir, dst_dir) + + try: + shutil.move(self.src_dir, dst_dir) + self.assertTrue(os.path.isdir(dst_dir)) + finally: + if os.path.exists(dst_dir): + os.rmdir(dst_dir) + + def test_main(): support.run_unittest(TestShutil, TestMove, TestCopyFile) |