From bf2ad3a677c948b2bc975a56d444a4f901497894 Mon Sep 17 00:00:00 2001 From: Felipe Barriga Richards Date: Mon, 27 Feb 2017 00:15:03 -0300 Subject: [PATCH] tests.py: Check xattr module version. Fix to work with version xattr 0.9.1 --- test/tests.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) 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) -- 2.39.2