test.patch revision 2757
2757N/AEvery file on Solaris 11 and on has two extended attributes, so if we find
2757N/Athem, we shouldn't fail. Also, we don't support extended attributes on
2757N/Asymlinks, so just quietly pass that test.
2757N/A
2757N/AMerged as of 0.7.6.
2757N/A
2757N/Adiff --git a/xattr/tests/test_xattr.py b/xattr/tests/test_xattr.py
2757N/A--- a/xattr/tests/test_xattr.py Mon Mar 3 10:12:24 2014
2757N/A+++ b/xattr/tests/test_xattr.py Wed Mar 26 16:29:24 2014
2757N/A@@ -1,4 +1,5 @@
2757N/A import os
2757N/A+import sys
2757N/A from unittest import TestCase
2757N/A from tempfile import mkdtemp, NamedTemporaryFile
2757N/A
2757N/A@@ -8,10 +9,19 @@
2757N/A class BaseTestXattr(object):
2757N/A def test_attr(self):
2757N/A x = xattr.xattr(self.tempfile)
2757N/A- self.assertEqual(x.keys(), [])
2757N/A- self.assertEqual(x.list(), [])
2757N/A- self.assertEqual(dict(x), {})
2757N/A
2757N/A+ # Solaris 11 and forward contain system attributes (file flags) in
2757N/A+ # extended attributes present on all files, so cons them up into a
2757N/A+ # comparison dict.
2757N/A+ d = {}
2757N/A+ if sys.platform == 'sunos5' and 'SUNWattr_ro' in x:
2757N/A+ d['SUNWattr_ro'] = x['SUNWattr_ro']
2757N/A+ d['SUNWattr_rw'] = x['SUNWattr_rw']
2757N/A+
2757N/A+ self.assertEqual(x.keys(), d.keys())
2757N/A+ self.assertEqual(x.list(), d.keys())
2757N/A+ self.assertEqual(dict(x), d)
2757N/A+
2757N/A x['user.sopal'] = b'foo'
2757N/A x['user.sop.foo'] = b'bar'
2757N/A x[u'user.\N{SNOWMAN}'] = b'not a snowman'
2757N/A@@ -38,6 +48,9 @@
2757N/A self.assertTrue('user.sop.foo' not in x)
2757N/A
2757N/A def test_symlink_attrs(self):
2757N/A+ # Solaris doesn't support extended attributes on symlinks
2757N/A+ if sys.platform == 'sunos5':
2757N/A+ return
2757N/A symlinkPath = self.tempfilename + '.link'
2757N/A os.symlink(self.tempfilename, symlinkPath)
2757N/A try: