Commit d60e92a4 authored by Johannes Gijsbers's avatar Johannes Gijsbers

Document not-completely-obvious behavior in a test.

parent 6ab4b99f
......@@ -16,6 +16,13 @@ class TestShutil(unittest.TestCase):
self.assertEqual(shutil.rmtree(filename, True), None)
shutil.rmtree(filename, False, lambda func, arg, exc: None)
def test_rmtree_dont_delete_file(self):
# When called on a file instead of a directory, don't delete it.
handle, path = tempfile.mkstemp()
os.fdopen(handle).close()
self.assertRaises(OSError, shutil.rmtree, path)
os.remove(path)
def test_dont_move_dir_in_itself(self):
src_dir = tempfile.mkdtemp()
try:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment