mirror of
https://github.com/python/cpython.git
synced 2025-08-01 15:43:13 +00:00
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:
parent
0713a68dc5
commit
382abeff0f
11 changed files with 133 additions and 10 deletions
|
@ -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)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue