test: fix minor pylint warnings

This fixes a bunch of minor pylint warnings:
  * Drop unused imports.
  * Fix "inline-JSON" formatting.
  * Fix space before/after brackets.
  * Use `_` for unused variables.
  * Break overlong lines.
  * Mark unittest as `no-self-use` if applicable.
  * Drop spurious newline at end of file.
This commit is contained in:
David Rheinsberg 2020-04-20 08:18:24 +02:00 committed by Tom Gundersen
parent 617ed6ed29
commit 72be939521
8 changed files with 50 additions and 45 deletions

View file

@ -87,6 +87,7 @@ class TestObjectStore(unittest.TestCase):
# there should be no temporary Objects dirs anymore
self.assertEqual(len(os.listdir(object_store.tmp)), 0)
# pylint: disable=no-self-use
@unittest.skipUnless(can_set_immutable(), "Need root permissions")
def test_cleanup_immutable(self):
with tempfile.TemporaryDirectory(dir="/var/tmp") as tmp:
@ -98,6 +99,7 @@ class TestObjectStore(unittest.TestCase):
subprocess.run(["chattr", "+i", f"{path}/A"],
check=True)
# pylint: disable=no-self-use
def test_duplicate(self):
with tempfile.TemporaryDirectory(dir="/var/tmp") as tmp:
object_store = objectstore.ObjectStore(tmp)
@ -122,6 +124,7 @@ class TestObjectStore(unittest.TestCase):
assert len(os.listdir(f"{object_store.refs}/a/")) == 1
assert len(os.listdir(f"{object_store.refs}/b/")) == 1
# pylint: disable=no-self-use
def test_object_base(self):
# operate with a clean object store
with tempfile.TemporaryDirectory(dir="/var/tmp") as tmp: