projects
/
rrq
/
fuse_xattrs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e03e212
)
tests.py: Check xattr module version. Fix to work with version xattr 0.9.1
author
Felipe Barriga Richards
<spam@felipebarriga.cl>
Mon, 27 Feb 2017 03:15:03 +0000
(
00:15
-0300)
committer
Felipe Barriga Richards
<spam@felipebarriga.cl>
Mon, 27 Feb 2017 03:15:03 +0000
(
00:15
-0300)
test/tests.py
patch
|
blob
|
history
diff --git
a/test/tests.py
b/test/tests.py
index 51e7b1e6a7295160ee05dc4945178ac4202697a0..38452e5c5a65d947d95e0445d3e1caeab0635aec 100755
(executable)
--- a/
test/tests.py
+++ b/
test/tests.py
@@
-14,6
+14,9
@@
import xattr
from pathlib import Path
import os
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
# TODO
# - listxattr: list too long
# - sidecar file permissions
@@
-161,9
+164,9
@@
class TestXAttrs(unittest.TestCase):
def test_xattr_list(self):
enc = "utf-8"
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
value = "bar"
# set 3 keys
@@
-190,7
+193,7
@@
class TestXAttrs(unittest.TestCase):
# list
attrs = xattr.listxattr(self.randomFile)
self.assertEqual(len(attrs), 1)
# list
attrs = xattr.listxattr(self.randomFile)
self.assertEqual(len(attrs), 1)
- self.assert
True(key.encode() in attrs
)
+ self.assert
Equal(attrs[0], key
)
# read
read_value = xattr.getxattr(self.randomFile, key)
# read
read_value = xattr.getxattr(self.randomFile, key)