From: Kamalesh Babulal Date: Tue, 15 Feb 2022 07:25:59 +0000 (+0530) Subject: test-033: make it PEP8 compliant X-Git-Tag: v3.1.0~308^2~2^2~72 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e99005be60fad278c25668c15de6de8b3f6dc401;p=thirdparty%2Flibcgroup.git test-033: make it PEP8 compliant Make test 033-cgget-no_flags.py PEP-8 compliant. Signed-off-by: Kamalesh Babulal Signed-off-by: Tom Hromatka --- diff --git a/ftests/033-cgget-no_flags.py b/ftests/033-cgget-no_flags.py index 92f3d8e4..14c4e757 100755 --- a/ftests/033-cgget-no_flags.py +++ b/ftests/033-cgget-no_flags.py @@ -20,45 +20,55 @@ # along with this library; if not, see . # -from cgroup import Cgroup, CgroupVersion +from cgroup import Cgroup import consts import ftests -import os import sys +import os CONTROLLER = 'cpuset' CGNAME = '033cgget' + 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 out = Cgroup.get(config, controller=None, cgname=CGNAME) - if out.splitlines()[0] != "{}:".format(CGNAME): + if out.splitlines()[0] != '{}:'.format(CGNAME): result = consts.TEST_FAILED - cause = "cgget expected the cgroup name {} in the first line.\n" \ - "Instead it received {}".format(CGNAME, out.splitlines()[0]) + cause = ( + 'cgget expected the cgroup name {} in the first line.\n' + 'Instead it received {}' + ''.format(CGNAME, out.splitlines()[0]) + ) if len(out.splitlines()) < 5: result = consts.TEST_FAILED - cause = "Too few lines output by cgget. Received {} lines".format( - len(out.splitlines())) + cause = ( + 'Too few lines output by cgget. Received {} lines' + ''.format(len(out.splitlines())) + ) return result, cause + def teardown(config): Cgroup.delete(config, CONTROLLER, CGNAME) + def main(config): [result, cause] = prereqs(config) if result != consts.TEST_PASSED: @@ -70,6 +80,7 @@ def main(config): return [result, cause] + if __name__ == '__main__': config = ftests.parse_args() # this test was invoked directly. run only it