From: Kamalesh Babulal Date: Tue, 15 Feb 2022 07:23:35 +0000 (+0530) Subject: test-030: make it PEP8 compliant X-Git-Tag: v3.1.0~308^2~2^2~75 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b62df12a09100bab5420e321050c31ca76750fff;p=thirdparty%2Flibcgroup.git test-030: make it PEP8 compliant Make test 030-lssubsys-lssubsys_all.py PEP-8 compliant. Signed-off-by: Kamalesh Babulal Signed-off-by: Tom Hromatka --- diff --git a/ftests/030-lssubsys-lssubsys_all.py b/ftests/030-lssubsys-lssubsys_all.py index 7c20fdb8..90112317 100755 --- a/ftests/030-lssubsys-lssubsys_all.py +++ b/ftests/030-lssubsys-lssubsys_all.py @@ -20,12 +20,12 @@ # 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 utils +import os + def prereqs(config): result = consts.TEST_PASSED @@ -33,9 +33,11 @@ def prereqs(config): return result, cause + def setup(config): pass + def test(config): result = consts.TEST_PASSED cause = None @@ -46,7 +48,7 @@ def test(config): lssubsys_list = Cgroup.lssubsys(config, ls_all=True) for mount in mount_list: - if mount.controller == "name=systemd" or mount.controller == "systemd": + if mount.controller == 'name=systemd' or mount.controller == 'systemd': continue found = False @@ -61,27 +63,31 @@ def test(config): found = True break - if lsmount == "blkio" and mount.controller == "io": + if lsmount == 'blkio' and mount.controller == 'io': found = True break if not found: result = consts.TEST_FAILED - cause = "Failed to find {} in lssubsys list".format( - mount.controller) + cause = ( + 'Failed to find {} in lssubsys list' + ''.format(mount.controller) + ) return result, cause ret = Cgroup.lssubsys(config, cghelp=True) - if not "Usage:" in ret: + if 'Usage:' not in ret: result = consts.TEST_FAILED - cause = "Failed to print help text" + cause = 'Failed to print help text' return result, cause return result, cause + def teardown(config): pass + def main(config): [result, cause] = prereqs(config) if result != consts.TEST_PASSED: @@ -95,6 +101,7 @@ def main(config): return [result, cause] + if __name__ == '__main__': config = ftests.parse_args() # this test was invoked directly. run only it