]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test/pybind: pep8 cleanups
authorKefu Chai <kchai@redhat.com>
Wed, 9 Jun 2021 02:00:08 +0000 (10:00 +0800)
committerKefu Chai <kchai@redhat.com>
Mon, 14 Jun 2021 01:50:46 +0000 (09:50 +0800)
* do not import unused symbols
* add two empty lines before method
* aligned indents

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/test/pybind/test_ceph_argparse.py

index e9596a177c593650f3ee7857b98d11a698a1bc9c..3d520077626a9d38e94a351de3fe8317424f45ea 100755 (executable)
@@ -15,8 +15,9 @@
 #  version 2.1 of the License, or (at your option) any later version.
 #
 
-from nose.tools import eq_ as eq
-from nose.tools import *
+from nose.tools import assert_equal, assert_raises, \
+    assert_not_in, assert_in, \
+    assert_regexp_matches
 from unittest import TestCase
 
 from ceph_argparse import validate_command, parse_json_funcsigs, validate, \
@@ -28,18 +29,19 @@ import random
 import re
 import string
 import sys
-import json
 try:
     from StringIO import StringIO
 except ImportError:
     from io import StringIO
 
+
 def get_command_descriptions(what):
     CEPH_BIN = os.environ['CEPH_BIN']
     if CEPH_BIN == "":
         CEPH_BIN = "."
     return os.popen(CEPH_BIN + "/get_command_descriptions " + "--" + what).read()
 
+
 def test_parse_json_funcsigs():
     commands = get_command_descriptions("all")
     cmd_json = parse_json_funcsigs(commands, 'cli')
@@ -48,6 +50,7 @@ def test_parse_json_funcsigs():
     commands = get_command_descriptions("pull585")
     assert_raises(TypeError, parse_json_funcsigs, commands, 'cli')
 
+
 sigdict = parse_json_funcsigs(get_command_descriptions("all"), 'cli')
 
 
@@ -1281,8 +1284,8 @@ class TestValidate(TestCase):
             a_type = arg_type
             if a_type == self.MIXED:
                 a_type = random.choice((self.ARGS,
-                                          self.KWARGS,
-                                          self.KWARGS_EQ))
+                                        self.KWARGS,
+                                        self.KWARGS_EQ))
             if a_type == self.ARGS:
                 final_args.append(v)
             elif a_type == self.KWARGS: