]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
test-032: make it PEP8 compliant
authorKamalesh Babulal <kamalesh.babulal@oracle.com>
Tue, 15 Feb 2022 07:25:13 +0000 (12:55 +0530)
committerTom Hromatka <tom.hromatka@oracle.com>
Wed, 16 Feb 2022 19:09:18 +0000 (12:09 -0700)
Make test 032-lscgroup-multiple_g_flags.py PEP-8 compliant.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
ftests/032-lscgroup-multiple_g_flags.py

index 03f7c292c8fc86b146da23b0cf57b64775549576..6fa80fac78f7f77d1af8084285cd4b7d3ecc2d4a 100755 (executable)
@@ -23,9 +23,9 @@
 from cgroup import Cgroup, CgroupVersion
 import consts
 import ftests
-import os
-import sys
 import utils
+import sys
+import os
 
 CONTROLLER = 'cpuset'
 PARENT_CGNAME = '032lscgroup'
@@ -52,6 +52,7 @@ EXPECTED_OUT1 = '''{}:/{}/
                     CONTROLLER, SIBLING_CGNAME,
                     CONTROLLER, SIBLING_CGNAME, SIBLING_CHILD_CGNAME)
 
+
 def prereqs(config):
     result = consts.TEST_PASSED
     cause = None
@@ -68,14 +69,16 @@ def prereqs(config):
         # properly list the enabled controllers for a cgroup v2 cgroup.
         # Skip this test because of this
         result = consts.TEST_SKIPPED
-        cause = "See Github Issue #50 - lscgroup lists controllers..."
+        cause = 'See Github Issue #50 - lscgroup lists controllers...'
         return result, cause
 
     return result, cause
 
+
 def setup(config):
     Cgroup.create(config, CONTROLLER, PARENT_CGNAME)
-    Cgroup.create(config, CONTROLLER, os.path.join(PARENT_CGNAME, CHILD_CGNAME))
+    Cgroup.create(config, CONTROLLER,
+                  os.path.join(PARENT_CGNAME, CHILD_CGNAME))
     Cgroup.create(config, CONTROLLER,
                   os.path.join(PARENT_CGNAME, CHILD_CGNAME, GRANDCHILD_CGNAME))
 
@@ -83,6 +86,7 @@ def setup(config):
     Cgroup.create(config, CONTROLLER,
                   os.path.join(SIBLING_CGNAME, SIBLING_CHILD_CGNAME))
 
+
 def test(config):
     result = consts.TEST_PASSED
     cause = None
@@ -91,24 +95,29 @@ def test(config):
                           path=[PARENT_CGNAME, SIBLING_CGNAME])
     if out != EXPECTED_OUT1:
         result = consts.TEST_FAILED
-        cause = "Expected lscgroup output doesn't match received output\n" \
-                "Expected:\n{}\n" \
-                "Received:\n{}\n".format(utils.indent(EXPECTED_OUT1, 4),
-                                         utils.indent(out, 4))
+        cause = (
+                    "Expected lscgroup output doesn't match received output\n"
+                    "Expected:\n{}\n"
+                    "Received:\n{}\n"
+                    "".format(utils.indent(EXPECTED_OUT1, 4),
+                              utils.indent(out, 4))
+                )
         return result, cause
 
     ret = Cgroup.lscgroup(config, cghelp=True)
-    if not "Usage:" in ret:
+    if 'Usage:' not in ret:
         result = consts.TEST_FAILED
-        cause = "Failed to print help text"
+        cause = 'Failed to print help text'
         return result, cause
 
     return result, cause
 
+
 def teardown(config):
     Cgroup.delete(config, CONTROLLER, PARENT_CGNAME, recursive=True)
     Cgroup.delete(config, CONTROLLER, SIBLING_CGNAME, recursive=True)
 
+
 def main(config):
     [result, cause] = prereqs(config)
     if result != consts.TEST_PASSED:
@@ -120,6 +129,7 @@ def main(config):
 
     return [result, cause]
 
+
 if __name__ == '__main__':
     config = ftests.parse_args()
     # this test was invoked directly.  run only it