mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
gh-90473: Make chmod a dummy on WASI, skip chmod tests (GH-93534)
WASI does not have the ``chmod(2)`` syscall yet.
This commit is contained in:
parent
56b5daf159
commit
22fed605e0
20 changed files with 81 additions and 5 deletions
|
@ -74,6 +74,7 @@ class UUTest(unittest.TestCase):
|
|||
with self.assertRaises(TypeError):
|
||||
uu.encode(inp, out, "t1", 0o644, True)
|
||||
|
||||
@os_helper.skip_unless_working_chmod
|
||||
def test_decode(self):
|
||||
for backtick in True, False:
|
||||
inp = io.BytesIO(encodedtextwrapped(0o666, "t1", backtick=backtick))
|
||||
|
@ -199,6 +200,8 @@ class UUFileTest(unittest.TestCase):
|
|||
s = fout.read()
|
||||
self.assertEqual(s, encodedtextwrapped(0o644, self.tmpin))
|
||||
|
||||
# decode() calls chmod()
|
||||
@os_helper.skip_unless_working_chmod
|
||||
def test_decode(self):
|
||||
with open(self.tmpin, 'wb') as f:
|
||||
f.write(encodedtextwrapped(0o644, self.tmpout))
|
||||
|
@ -211,6 +214,7 @@ class UUFileTest(unittest.TestCase):
|
|||
self.assertEqual(s, plaintext)
|
||||
# XXX is there an xp way to verify the mode?
|
||||
|
||||
@os_helper.skip_unless_working_chmod
|
||||
def test_decode_filename(self):
|
||||
with open(self.tmpin, 'wb') as f:
|
||||
f.write(encodedtextwrapped(0o644, self.tmpout))
|
||||
|
@ -221,6 +225,7 @@ class UUFileTest(unittest.TestCase):
|
|||
s = f.read()
|
||||
self.assertEqual(s, plaintext)
|
||||
|
||||
@os_helper.skip_unless_working_chmod
|
||||
def test_decodetwice(self):
|
||||
# Verify that decode() will refuse to overwrite an existing file
|
||||
with open(self.tmpin, 'wb') as f:
|
||||
|
@ -231,6 +236,7 @@ class UUFileTest(unittest.TestCase):
|
|||
with open(self.tmpin, 'rb') as f:
|
||||
self.assertRaises(uu.Error, uu.decode, f)
|
||||
|
||||
@os_helper.skip_unless_working_chmod
|
||||
def test_decode_mode(self):
|
||||
# Verify that decode() will set the given mode for the out_file
|
||||
expected_mode = 0o444
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue