From: Kamalesh Babulal Date: Tue, 15 Feb 2022 07:33:33 +0000 (+0530) Subject: test-042: make it PEP8 compliant X-Git-Tag: v3.1.0~308^2~2^2~63 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bda9eac032eb701a6751596f812c800b498e4100;p=thirdparty%2Flibcgroup.git test-042: make it PEP8 compliant Make test 042-cgxget-unmappable.py PEP-8 compliant. Signed-off-by: Kamalesh Babulal Signed-off-by: Tom Hromatka --- diff --git a/ftests/042-cgxget-unmappable.py b/ftests/042-cgxget-unmappable.py index e96f5103..c252efc0 100755 --- a/ftests/042-cgxget-unmappable.py +++ b/ftests/042-cgxget-unmappable.py @@ -23,22 +23,25 @@ from cgroup import Cgroup, CgroupVersion import consts import ftests -import os import sys +import os CONTROLLER = 'cpu' CGNAME = '042cgxget' SETTING = 'cpu.stat' + def prereqs(config): result = consts.TEST_PASSED cause = None return result, cause + def setup(config): Cgroup.create(config, CONTROLLER, CGNAME) + def test(config): result = consts.TEST_PASSED cause = None @@ -49,18 +52,22 @@ def test(config): else: requested_ver = CgroupVersion.CGROUP_V1 - out = Cgroup.xget(config, cgname=CGNAME, setting=SETTING, - version=requested_ver, print_headers=False, - ignore_unmappable=True) + out = Cgroup.xget( + config, cgname=CGNAME, setting=SETTING, + version=requested_ver, print_headers=False, + ignore_unmappable=True + ) if len(out): result = consts.TEST_FAILED - cause = "Expected cgxget to return nothing. Received {}".format(out) + cause = 'Expected cgxget to return nothing. Received {}'.format(out) return result, cause + def teardown(config): Cgroup.delete(config, CONTROLLER, CGNAME) + def main(config): [result, cause] = prereqs(config) if result != consts.TEST_PASSED: @@ -72,6 +79,7 @@ def main(config): return [result, cause] + if __name__ == '__main__': config = ftests.parse_args() # this test was invoked directly. run only it