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

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

index 38850a91d6c7d09fdede68c78be35aa129fbf4fe..f1745469496452c8552ac47297831839ba86ec37 100755 (executable)
 # along with this library; if not, see <http://www.gnu.org/licenses>.
 #
 
-from cgroup import Cgroup, CgroupVersion
+from cgroup import Cgroup
 import consts
 import ftests
-import os
 import sys
+import os
 
-CONTROLLER='memory'
-CGNAME="015cgget"
+CONTROLLER = 'memory'
+CGNAME = '015cgget'
+
+SETTING = 'memory.stat'
+VALUE = '512'
 
-SETTING='memory.stat'
-VALUE='512'
 
 def prereqs(config):
     result = consts.TEST_PASSED
@@ -38,9 +39,11 @@ def prereqs(config):
 
     return result, cause
 
+
 def setup(config):
     Cgroup.create(config, CONTROLLER, CGNAME)
 
+
 def test(config):
     result = consts.TEST_PASSED
     cause = None
@@ -52,22 +55,26 @@ def test(config):
     # arbitrary check to ensure we read several lines
     if len(out.splitlines()) < 10:
         result = consts.TEST_FAILED
-        cause = "Expected multiple lines, but only received {}".format(
-                len(out.splitlines()))
+        cause = (
+                    'Expected multiple lines, but only received {}'
+                    ''.format(len(out.splitlines()))
+                )
         return result, cause
 
     # arbitrary check for a setting that's in both cgroup v1 and cgroup v2
     # memory.stat
-    if not "\tunevictable" in out:
+    if '\tunevictable' not in out:
         result = consts.TEST_FAILED
-        cause = "Unexpected output\n{}".format(out)
+        cause = 'Unexpected output\n{}'.format(out)
         return result, cause
 
     return result, cause
 
+
 def teardown(config):
     Cgroup.delete(config, CONTROLLER, CGNAME)
 
+
 def main(config):
     [result, cause] = prereqs(config)
     if result != consts.TEST_PASSED:
@@ -79,6 +86,7 @@ def main(config):
 
     return [result, cause]
 
+
 if __name__ == '__main__':
     config = ftests.parse_args()
     # this test was invoked directly.  run only it