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

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
ftests/030-lssubsys-lssubsys_all.py

index 7c20fdb887d9f1e867ebbe84312ae7c8976587a8..90112317687ad52a74e61fe0b284d73df63f006e 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 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