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

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
ftests/012-cgget-multiple_r_flags2.py

index a70cb423a7fb6ebc02cfc7ff0787303eda59af87..2d8ed1ba14325595ba5c18b337ac09bd7908bfc1 100755 (executable)
@@ -23,8 +23,8 @@
 from cgroup import Cgroup, CgroupVersion
 import consts
 import ftests
-import os
 import sys
+import os
 
 CONTROLLER = 'memory'
 CGNAME1 = '012cgget1'
@@ -47,12 +47,14 @@ EXPECTED_OUT = '''{}:
 {}
 '''.format(CGNAME1, VALUE1, VALUE2, CGNAME2, VALUE1, VALUE2)
 
+
 def prereqs(config):
     result = consts.TEST_PASSED
     cause = None
 
     return result, cause
 
+
 def setup(config):
     Cgroup.create(config, CONTROLLER, CGNAME1)
     Cgroup.create(config, CONTROLLER, CGNAME2)
@@ -70,6 +72,7 @@ def setup(config):
         Cgroup.set(config, CGNAME2, SETTING1_V2, VALUE1)
         Cgroup.set(config, CGNAME2, SETTING2_V2, VALUE2)
 
+
 def test(config):
     result = consts.TEST_PASSED
     cause = None
@@ -87,16 +90,21 @@ def test(config):
     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):
     Cgroup.delete(config, CONTROLLER, CGNAME1)
     Cgroup.delete(config, CONTROLLER, CGNAME2)
 
+
 def main(config):
     [result, cause] = prereqs(config)
     if result != consts.TEST_PASSED:
@@ -108,6 +116,7 @@ def main(config):
 
     return [result, cause]
 
+
 if __name__ == '__main__':
     config = ftests.parse_args()
     # this test was invoked directly.  run only it