From bc182888a3ca557e330e4317e0c50c1e80dbde4d Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Wed, 9 Jun 2021 10:00:08 +0800 Subject: [PATCH] test/pybind: pep8 cleanups * do not import unused symbols * add two empty lines before method * aligned indents Signed-off-by: Kefu Chai --- src/test/pybind/test_ceph_argparse.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/test/pybind/test_ceph_argparse.py b/src/test/pybind/test_ceph_argparse.py index e9596a177c5..3d520077626 100755 --- a/src/test/pybind/test_ceph_argparse.py +++ b/src/test/pybind/test_ceph_argparse.py @@ -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: -- 2.47.3