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

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
ftests/044-pybindings-cgcreate_empty_controller.py

index 33d594aac4dacbc159143baf677734ab9a22cf7c..7ac11a5b92ee0a2c5b64e73616a9065030f2e8bf 100755 (executable)
 # along with this library; if not, see <http://www.gnu.org/licenses>.
 #
 
-from cgroup import CgroupVersion
 from cgroup import Cgroup as CgroupCli
 from libcgroup import Cgroup, Version
+from cgroup import CgroupVersion
+from run import Run
 import consts
 import ftests
-import os
-from run import Run
 import sys
+import os
 
 CONTROLLER = 'cpu'
 PARENT_NAME = '044cgcreate'
 CGNAME = os.path.join(PARENT_NAME, 'madeviapython')
 
+
 def prereqs(config):
     result = consts.TEST_PASSED
     cause = None
 
     if config.args.container:
         result = consts.TEST_SKIPPED
-        cause = "This test cannot be run within a container"
+        cause = 'This test cannot be run within a container'
         return result, cause
 
     if CgroupVersion.get_version(CONTROLLER) != CgroupVersion.CGROUP_V2:
         result = consts.TEST_SKIPPED
-        cause = "This test requires cgroup v2"
+        cause = 'This test requires cgroup v2'
 
     return result, cause
 
+
 def setup(config):
     user_name = Run.run('whoami', shell_bool=True)
     group_name = Run.run('groups', shell_bool=True).split(' ')[0]
@@ -55,6 +57,7 @@ def setup(config):
     CgroupCli.create(config, controller_list=CONTROLLER, cgname=PARENT_NAME,
                      user_name=user_name, group_name=group_name)
 
+
 def test(config):
     result = consts.TEST_PASSED
     cause = None
@@ -64,14 +67,16 @@ def test(config):
 
     # Read a valid file within the newly created cgroup.
     # This should fail if the cgroup was not created successfully
-    cg.add_setting(setting_name="cgroup.procs")
+    cg.add_setting(setting_name='cgroup.procs')
     cg.cgxget()
 
     return result, cause
 
+
 def teardown(config):
     CgroupCli.delete(config, None, CGNAME)
 
+
 def main(config):
     [result, cause] = prereqs(config)
     if result != consts.TEST_PASSED:
@@ -83,6 +88,7 @@ def main(config):
 
     return [result, cause]
 
+
 if __name__ == '__main__':
     config = ftests.parse_args()
     # this test was invoked directly.  run only it