From: Kamalesh Babulal Date: Tue, 15 Feb 2022 07:34:01 +0000 (+0530) Subject: test-043: make it PEP8 compliant X-Git-Tag: v3.1.0~308^2~2^2~62 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f3a70f72b3d792d90e39fdf76a0e3981b738365b;p=thirdparty%2Flibcgroup.git test-043: make it PEP8 compliant Make test 043-cgcreate-empty_controller.py PEP-8 compliant. Signed-off-by: Kamalesh Babulal Signed-off-by: Tom Hromatka --- diff --git a/ftests/043-cgcreate-empty_controller.py b/ftests/043-cgcreate-empty_controller.py index f7d19cb7..5d5e79fc 100755 --- a/ftests/043-cgcreate-empty_controller.py +++ b/ftests/043-cgcreate-empty_controller.py @@ -23,13 +23,14 @@ from cgroup import Cgroup, CgroupVersion import consts import ftests -import os import sys +import os # Which controller isn't all that important, but it is important that we # have a cgroup v2 controller CONTROLLER = 'cpu' -CGNAME = "043cgcreate" +CGNAME = '043cgcreate' + def prereqs(config): result = consts.TEST_PASSED @@ -37,13 +38,15 @@ def prereqs(config): if CgroupVersion.get_version(CONTROLLER) != CgroupVersion.CGROUP_V2: result = consts.TEST_SKIPPED - cause = "This test requires cgroup v2" + cause = 'This test requires cgroup v2' return result, cause + def setup(config): return consts.TEST_PASSED, None + def test(config): result = consts.TEST_PASSED cause = None @@ -51,15 +54,19 @@ def test(config): Cgroup.create(config, None, CGNAME) # verify the cgroup exists by reading cgroup.procs - Cgroup.get(config, controller=None, cgname=CGNAME, - setting="cgroup.procs", print_headers=True, - values_only=False) + Cgroup.get( + config, controller=None, cgname=CGNAME, + setting='cgroup.procs', print_headers=True, + values_only=False + ) return result, cause + def teardown(config): Cgroup.delete(config, None, CGNAME) + def main(config): [result, cause] = prereqs(config) if result != consts.TEST_PASSED: @@ -74,6 +81,7 @@ def main(config): return [result, cause] + if __name__ == '__main__': config = ftests.parse_args() # this test was invoked directly. run only it