]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
This test doesn't pass on Windows. The cause seems to be that chmod
authorNeal Norwitz <nnorwitz@gmail.com>
Thu, 18 Jan 2007 06:20:55 +0000 (06:20 +0000)
committerNeal Norwitz <nnorwitz@gmail.com>
Thu, 18 Jan 2007 06:20:55 +0000 (06:20 +0000)
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).

Lib/test/test_dumbdbm.py

index e5dfe1d7e78ff57e9665756f23175ecc306eed82..62fa3dd74e94ff77bac4780bd429261fb5a0ca24 100644 (file)
@@ -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)