diff options
author | Neal Norwitz <nnorwitz@gmail.com> | 2007-01-18 06:20:55 (GMT) |
---|---|---|
committer | Neal Norwitz <nnorwitz@gmail.com> | 2007-01-18 06:20:55 (GMT) |
commit | 06a9a0ccf45a172b1f1a03a5e5f83c1c4478e89c (patch) | |
tree | b56d2c208a8b9920fe3a5335351d7159c3ac5ab7 | |
parent | b94ed71bd157bbcb25a2e82c4c0bc238a7647886 (diff) | |
download | cpython-06a9a0ccf45a172b1f1a03a5e5f83c1c4478e89c.zip cpython-06a9a0ccf45a172b1f1a03a5e5f83c1c4478e89c.tar.gz cpython-06a9a0ccf45a172b1f1a03a5e5f83c1c4478e89c.tar.bz2 |
This test doesn't pass on Windows. The cause seems to be that chmod
doesn't support the same funcationality as on Unix. I'm not sure if
this fix is the best (or if it will even work)--it's a test to see
if the buildbots start passing again.
It might be better to not even run this test if it's windows (or non-posix).
-rw-r--r-- | Lib/test/test_dumbdbm.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/Lib/test/test_dumbdbm.py b/Lib/test/test_dumbdbm.py index e5dfe1d..62fa3dd 100644 --- a/Lib/test/test_dumbdbm.py +++ b/Lib/test/test_dumbdbm.py @@ -50,11 +50,17 @@ class DumbDBMTestCase(unittest.TestCase): finally: os.umask(old_umask) + expected_mode = 0635 + if os.name != 'posix': + # Windows only supports setting the read-only attribute. + # This shouldn't fail, but doesn't work like Unix either. + expected_mode = 0666 + import stat st = os.stat(_fname + '.dat') - self.assertEqual(stat.S_IMODE(st.st_mode), 0635) + self.assertEqual(stat.S_IMODE(st.st_mode), expected_mode) st = os.stat(_fname + '.dir') - self.assertEqual(stat.S_IMODE(st.st_mode), 0635) + self.assertEqual(stat.S_IMODE(st.st_mode), expected_mode) def test_close_twice(self): f = dumbdbm.open(_fname) |