diff options
author | Johannes Gijsbers <jlg@dds.nl> | 2004-09-11 21:26:21 (GMT) |
---|---|---|
committer | Johannes Gijsbers <jlg@dds.nl> | 2004-09-11 21:26:21 (GMT) |
commit | d60e92a48d1e4d2298200e688329eda7a326be4a (patch) | |
tree | 6c66d75d0f7a09a69373946662464942a4088aa9 /Lib/test | |
parent | 6ab4b99f954a5675e5f66468522226f1c668ba37 (diff) | |
download | cpython-d60e92a48d1e4d2298200e688329eda7a326be4a.zip cpython-d60e92a48d1e4d2298200e688329eda7a326be4a.tar.gz cpython-d60e92a48d1e4d2298200e688329eda7a326be4a.tar.bz2 |
Document not-completely-obvious behavior in a test.
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_shutil.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_shutil.py b/Lib/test/test_shutil.py index 9e5f6ff..f8367a6 100644 --- a/Lib/test/test_shutil.py +++ b/Lib/test/test_shutil.py @@ -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: |