summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>2003-01-24 17:34:13 (GMT)
committerBarry Warsaw <barry@python.org>2003-01-24 17:34:13 (GMT)
commit7fc2cca7d9056f6eacf7ccefdd136ed5f1496066 (patch)
tree6fc8d3a57548262d70c04573edf963491ed5a37e /Lib
parent6d9f9b3b67d006e4c8b8d788b1742783da90552d (diff)
downloadcpython-7fc2cca7d9056f6eacf7ccefdd136ed5f1496066.zip
cpython-7fc2cca7d9056f6eacf7ccefdd136ed5f1496066.tar.gz
cpython-7fc2cca7d9056f6eacf7ccefdd136ed5f1496066.tar.bz2
A very minimal start to a test of the shutil module.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_shutil.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/Lib/test/test_shutil.py b/Lib/test/test_shutil.py
new file mode 100644
index 0000000..cd2469a
--- /dev/null
+++ b/Lib/test/test_shutil.py
@@ -0,0 +1,28 @@
+# Copyright (C) 2003 Python Software Foundation
+
+import unittest
+import shutil
+import tempfile
+from test import test_support
+
+class TestShutil(unittest.TestCase):
+ def test_rmtree_errors(self):
+ # filename is guaranteed not to exist
+ filename = tempfile.mktemp()
+ self.assertRaises(OSError, shutil.rmtree, filename)
+ self.assertEqual(shutil.rmtree(filename, True), None)
+
+
+
+def suite():
+ suite = unittest.TestSuite()
+ suite.addTest(unittest.makeSuite(TestShutil))
+ return suite
+
+
+def test_main():
+ test_support.run_suite(suite())
+
+
+if __name__ == '__main__':
+ unittest.main(defaultTest='suite')