Patch #1490190: posixmodule now includes os.chflags() and os.lchflags()

functions on platforms where the underlying system calls are available.
This commit is contained in:
Martin v. Löwis 2007-02-19 10:55:19 +00:00
parent 0713a68dc5
commit 382abeff0f
11 changed files with 133 additions and 10 deletions

View file

@ -192,6 +192,18 @@ class PosixTester(unittest.TestCase):
posix.utime(test_support.TESTFN, (int(now), int(now)))
posix.utime(test_support.TESTFN, (now, now))
def test_chflags(self):
if hasattr(posix, 'chflags'):
st = os.stat(test_support.TESTFN)
if hasattr(st, 'st_flags'):
posix.chflags(test_support.TESTFN, st.st_flags)
def test_lchflags(self):
if hasattr(posix, 'lchflags'):
st = os.stat(test_support.TESTFN)
if hasattr(st, 'st_flags'):
posix.lchflags(test_support.TESTFN, st.st_flags)
def test_main():
test_support.run_unittest(PosixTester)