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

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
ftests/033-cgget-no_flags.py

index 92f3d8e48794d68fbebb4dfaba9daebef46cca24..14c4e757034c6ad23fe099bdb037afca040b0827 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 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