From: Felipe Barriga Richards Date: Mon, 27 Feb 2017 03:15:03 +0000 (-0300) Subject: tests.py: Check xattr module version. Fix to work with version xattr 0.9.1 X-Git-Url: https://git.rrq.au/?a=commitdiff_plain;h=bf2ad3a677c948b2bc975a56d444a4f901497894;p=rrq%2Ffuse_xattrs.git tests.py: Check xattr module version. Fix to work with version xattr 0.9.1 --- diff --git a/test/tests.py b/test/tests.py index 51e7b1e..38452e5 100755 --- a/test/tests.py +++ b/test/tests.py @@ -14,6 +14,9 @@ import xattr from pathlib import Path import os +if xattr.__version__ != '0.9.1': + print("WARNING, only tested with xattr version 0.9.1") + # TODO # - listxattr: list too long # - sidecar file permissions @@ -161,9 +164,9 @@ class TestXAttrs(unittest.TestCase): def test_xattr_list(self): enc = "utf-8" - key1 = b"user.foo" - key2 = b"user.foo2" - key3 = b"user.foo3" + key1 = "user.foo" + key2 = "user.foo2" + key3 = "user.foo3" value = "bar" # set 3 keys @@ -190,7 +193,7 @@ class TestXAttrs(unittest.TestCase): # list attrs = xattr.listxattr(self.randomFile) self.assertEqual(len(attrs), 1) - self.assertTrue(key.encode() in attrs) + self.assertEqual(attrs[0], key) # read read_value = xattr.getxattr(self.randomFile, key)