summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_shutil.py
diff options
context:
space:
mode:
authorRonald Oussoren <ronaldoussoren@mac.com>2011-05-06 08:23:04 (GMT)
committerRonald Oussoren <ronaldoussoren@mac.com>2011-05-06 08:23:04 (GMT)
commitf51738b10e83d0adf404ca989970a5b44700d685 (patch)
tree1fc30e8a697333459b9e0a8eb4ff14bd92084a96 /Lib/test/test_shutil.py
parentd92ab0806d38cc592f303545d649821daa802997 (diff)
downloadcpython-f51738b10e83d0adf404ca989970a5b44700d685.zip
cpython-f51738b10e83d0adf404ca989970a5b44700d685.tar.gz
cpython-f51738b10e83d0adf404ca989970a5b44700d685.tar.bz2
Fix for issue 10684: Folders get deleted when trying to change case with shutil.move (case insensitive file systems only)
Diffstat (limited to 'Lib/test/test_shutil.py')
-rw-r--r--Lib/test/test_shutil.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/Lib/test/test_shutil.py b/Lib/test/test_shutil.py
index becd91c..8547351 100644
--- a/Lib/test/test_shutil.py
+++ b/Lib/test/test_shutil.py
@@ -522,6 +522,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)