Simple improvements for quality gate (#2517)

* Improvements for quality gate

* Update test_xattr.py

* Update test_mpc_wobble.py

* python

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
This commit is contained in:
Jon Ander Oribe
2020-11-12 23:48:45 +01:00
committed by GitHub
parent 7b72bbe9f3
commit 887d67eb8d
3 changed files with 9 additions and 10 deletions
+8 -7
View File
@@ -6,6 +6,7 @@ import unittest
from common.xattr import getxattr, setxattr, listxattr, removexattr
class TestParams(unittest.TestCase):
USER_TEST='user.test'
def setUp(self):
self.tmpdir = tempfile.mkdtemp()
self.tmpfn = os.path.join(self.tmpdir, 'test.txt')
@@ -16,7 +17,7 @@ class TestParams(unittest.TestCase):
shutil.rmtree(self.tmpdir)
def test_getxattr_none(self):
a = getxattr(self.tmpfn, 'user.test')
a = getxattr(self.tmpfn, TestParams.USER_TEST)
assert a is None
def test_listxattr_none(self):
@@ -24,8 +25,8 @@ class TestParams(unittest.TestCase):
assert l == []
def test_setxattr(self):
setxattr(self.tmpfn, 'user.test', b'123')
a = getxattr(self.tmpfn, 'user.test')
setxattr(self.tmpfn, TestParams.USER_TEST, b'123')
a = getxattr(self.tmpfn, TestParams.USER_TEST)
assert a == b'123'
def test_listxattr(self):
@@ -35,11 +36,11 @@ class TestParams(unittest.TestCase):
assert l == ['user.test1', 'user.test2']
def test_removexattr(self):
setxattr(self.tmpfn, 'user.test', b'123')
a = getxattr(self.tmpfn, 'user.test')
setxattr(self.tmpfn, TestParams.USER_TEST, b'123')
a = getxattr(self.tmpfn, TestParams.USER_TEST)
assert a == b'123'
removexattr(self.tmpfn, 'user.test')
a = getxattr(self.tmpfn, 'user.test')
removexattr(self.tmpfn, TestParams.USER_TEST)
a = getxattr(self.tmpfn, TestParams.USER_TEST)
assert a is None
if __name__ == "__main__":