From 16a79e753a964df8c87af9151731878f804bc85d Mon Sep 17 00:00:00 2001 From: Felipe Barriga Richards Date: Wed, 15 Feb 2017 21:55:40 -0300 Subject: [PATCH] tests: fixing broken tests. --- test/tests.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/test/tests.py b/test/tests.py index eb42540..48a10f3 100755 --- a/test/tests.py +++ b/test/tests.py @@ -22,8 +22,8 @@ import os class TestXAttrs(unittest.TestCase): def setUp(self): - self.randomFile = "./mount/tmp/foo.txt" - self.randomFileSidecar = "./mount/tmp/foo.txt.xattr" + self.randomFile = "./mount/foo.txt" + self.randomFileSidecar = "./mount/foo.txt.xattr" if os.path.isfile(self.randomFile): os.remove(self.randomFile) Path(self.randomFile).touch() @@ -33,6 +33,8 @@ class TestXAttrs(unittest.TestCase): def tearDown(self): os.remove(self.randomFile) + if os.path.isfile(self.randomFileSidecar): + os.remove(self.randomFileSidecar) def test_xattr_set(self): xattr.setxattr(self.randomFile, "user.foo", bytes("bar", "utf-8")) @@ -146,9 +148,9 @@ class TestXAttrs(unittest.TestCase): def test_xattr_list(self): enc = "utf-8" - key1 = "user.foo" - key2 = "user.foo2" - key3 = "user.foo3" + key1 = b"user.foo" + key2 = b"user.foo2" + key3 = b"user.foo3" value = "bar" # set 3 keys @@ -175,7 +177,7 @@ class TestXAttrs(unittest.TestCase): # list attrs = xattr.listxattr(self.randomFile) self.assertEqual(len(attrs), 1) - self.assertTrue(key in attrs) + self.assertTrue(key.encode() in attrs) # read read_value = xattr.getxattr(self.randomFile, key) -- 2.39.2