diff options
author | Kristján Valur Jónsson <kristjan@ccpgames.com> | 2009-02-06 10:17:34 (GMT) |
---|---|---|
committer | Kristján Valur Jónsson <kristjan@ccpgames.com> | 2009-02-06 10:17:34 (GMT) |
commit | e20f54f542195e053653b1902db7a4c1642f4589 (patch) | |
tree | 5a10f1e539562223abd21de6982c25a711baf189 | |
parent | 98da8e151ac8117aa84819903d7b3fb844b4e630 (diff) | |
download | cpython-e20f54f542195e053653b1902db7a4c1642f4589.zip cpython-e20f54f542195e053653b1902db7a4c1642f4589.tar.gz cpython-e20f54f542195e053653b1902db7a4c1642f4589.tar.bz2 |
Fix a number of Win32ErrorTests error cases. chmod wasn't being tested. 'access' never raises an error.
-rw-r--r-- | Lib/test/test_os.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py index 4180d06..64b29ea 100644 --- a/Lib/test/test_os.py +++ b/Lib/test/test_os.py @@ -524,16 +524,18 @@ class Win32ErrorTests(unittest.TestCase): self.assertRaises(WindowsError, os.chdir, test_support.TESTFN) def test_mkdir(self): - self.assertRaises(WindowsError, os.chdir, test_support.TESTFN) + f = open(test_support.TESTFN, "w") + try: + self.assertRaises(WindowsError, os.mkdir, test_support.TESTFN) + finally: + f.close() + os.unlink(test_support.TESTFN) def test_utime(self): self.assertRaises(WindowsError, os.utime, test_support.TESTFN, None) - def test_access(self): - self.assertRaises(WindowsError, os.utime, test_support.TESTFN, 0) - def test_chmod(self): - self.assertRaises(WindowsError, os.utime, test_support.TESTFN, 0) + self.assertRaises(WindowsError, os.chmod, test_support.TESTFN, 0) class TestInvalidFD(unittest.TestCase): singles = ["fchdir", "fdopen", "dup", "fdatasync", "fstat", |