Author: Ronan Lamy <[email protected]>
Branch: py3.5-xattr
Changeset: r93492:eef439fa3527
Date: 2017-12-19 15:42 +0000
http://bitbucket.org/pypy/pypy/changeset/eef439fa3527/

Log:    Fix test_xattr()

diff --git a/rpython/rlib/test/test_rposix.py b/rpython/rlib/test/test_rposix.py
--- a/rpython/rlib/test/test_rposix.py
+++ b/rpython/rlib/test/test_rposix.py
@@ -836,19 +836,22 @@
     with open(fname, 'wb'):
         pass
     try:
-        rposix.getxattr(fname, 'foo')
-    except OSError as e:
-        return e.errno != errno.ENOTSUP
+        rposix.setxattr(fname, 'user.foo', '')
+    except OSError:
+        return False
     else:
-       raise RuntimeError('getxattr() succeeded unexpectedly!?!')
+        return True
 
 @pytest.mark.skipif(not (hasattr(rposix, 'getxattr') and 
check_working_xattr()),
     reason="Requires working rposix.getxattr()")
-@given(name=st.binary(max_size=10), value=st.binary(max_size=10),
+@given(
+    name=st.text(
+        alphabet=st.characters(min_codepoint=1), min_size=1, max_size=10),
+    value=st.binary(max_size=10),
     follow_symlinks=st.booleans(), use_fd=st.booleans())
 def test_xattr(name, value, follow_symlinks, use_fd):
-    use_fd = False
     assume(follow_symlinks or not use_fd)
+    name = 'user.' + name.encode('utf-8')
     fname = str(udir.join('xattr_test.txt'))
     with open(fname, 'wb'):
         pass
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to