mirror of
https://github.com/python/cpython.git
synced 2025-08-10 03:49:18 +00:00
Backport fix for issue #10684 from 3.x
This commit is contained in:
parent
fe12aa67fc
commit
58d6b1b7a4
3 changed files with 28 additions and 0 deletions
|
@ -805,6 +805,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():
|
||||
test_support.run_unittest(TestShutil, TestMove, TestCopyFile)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue