]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
test-013: make it PEP8 compliant
authorKamalesh Babulal <kamalesh.babulal@oracle.com>
Tue, 15 Feb 2022 07:03:06 +0000 (12:33 +0530)
committerTom Hromatka <tom.hromatka@oracle.com>
Wed, 16 Feb 2022 19:09:18 +0000 (12:09 -0700)
Make test 013-cgget-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/013-cgget-multiple_g_flags.py

index cbb0c2f6b345881fce3b79d537a1ff2bc6d9efdf..557f50d352bae433f3be4b57e6a68f303709c485 100755 (executable)
@@ -23,9 +23,8 @@
 from cgroup import Cgroup, CgroupVersion
 import consts
 import ftests
-import os
-from run import RunError
 import sys
+import os
 
 CONTROLLER1 = 'pids'
 CONTROLLER2 = 'cpu'
@@ -63,16 +62,19 @@ cpu.uclamp.min: 0.00
 cpu.uclamp.max: max
 '''
 
+
 def prereqs(config):
     result = consts.TEST_PASSED
     cause = None
 
     return result, cause
 
+
 def setup(config):
     Cgroup.create(config, CONTROLLER1, CGNAME)
     Cgroup.create(config, CONTROLLER2, CGNAME)
 
+
 def test(config):
     result = consts.TEST_PASSED
     cause = None
@@ -89,19 +91,26 @@ def test(config):
 
     if len(out.splitlines()) != len(expected_out.splitlines()):
         result = consts.TEST_FAILED
-        cause = "Expected {} lines but received {} lines".format(
-                len(expected_out.splitlines()), len(out.splitlines()))
+        cause = (
+                    'Expected {} lines but received {} lines'
+                    ''.format(len(expected_out.splitlines()),
+                              len(out.splitlines()))
+                )
         return result, cause
 
     for line_num, line in enumerate(out.splitlines()):
         if line.strip() != expected_out.splitlines()[line_num].strip():
             result = consts.TEST_FAILED
-            cause = "Expected line:\n\t{}\nbut received line:\n\t{}".format(
-                    expected_out.splitlines()[line_num].strip(), line.strip())
+            cause = (
+                        'Expected line:\n\t{}\nbut received line:\n\t{}'
+                        ''.format(expected_out.splitlines()[line_num].strip(),
+                                  line.strip())
+                    )
             return result, cause
 
     return result, cause
 
+
 def teardown(config):
     ver1 = CgroupVersion.get_version(CONTROLLER1)
     ver2 = CgroupVersion.get_version(CONTROLLER2)
@@ -115,6 +124,7 @@ def teardown(config):
         Cgroup.delete(config, CONTROLLER1, CGNAME)
         Cgroup.delete(config, CONTROLLER2, CGNAME)
 
+
 def main(config):
     [result, cause] = prereqs(config)
     if result != consts.TEST_PASSED:
@@ -126,6 +136,7 @@ def main(config):
 
     return [result, cause]
 
+
 if __name__ == '__main__':
     config = ftests.parse_args()
     # this test was invoked directly.  run only it