Barry Warsaw | 7fc2cca | 2003-01-24 17:34:13 +0000 | [diff] [blame] | 1 | # Copyright (C) 2003 Python Software Foundation |
| 2 | |
| 3 | import unittest |
| 4 | import shutil |
| 5 | import tempfile |
| 6 | from test import test_support |
| 7 | |
| 8 | class TestShutil(unittest.TestCase): |
| 9 | def test_rmtree_errors(self): |
| 10 | # filename is guaranteed not to exist |
| 11 | filename = tempfile.mktemp() |
| 12 | self.assertRaises(OSError, shutil.rmtree, filename) |
| 13 | self.assertEqual(shutil.rmtree(filename, True), None) |
| 14 | |
| 15 | |
| 16 | |
| 17 | def suite(): |
| 18 | suite = unittest.TestSuite() |
| 19 | suite.addTest(unittest.makeSuite(TestShutil)) |
| 20 | return suite |
| 21 | |
| 22 | |
| 23 | def test_main(): |
| 24 | test_support.run_suite(suite()) |
| 25 | |
| 26 | |
| 27 | if __name__ == '__main__': |
| 28 | unittest.main(defaultTest='suite') |