From 2efc0db8d4f14d30b38eaafa165e0b74215a95d1 Mon Sep 17 00:00:00 2001 From: Jakub Roztocil Date: Thu, 24 Nov 2016 00:58:41 +0100 Subject: [PATCH] Cleanup --- httpie/cli.py | 10 +++++----- tests/test_auth_plugins.py | 3 ++- tests/test_binary.py | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/httpie/cli.py b/httpie/cli.py index 038efd6e..2194321b 100644 --- a/httpie/cli.py +++ b/httpie/cli.py @@ -3,18 +3,14 @@ NOTE: the CLI interface may change before reaching v1.0. """ -from textwrap import dedent, wrap # noinspection PyCompatibility from argparse import ( RawDescriptionHelpFormatter, FileType, OPTIONAL, ZERO_OR_MORE, SUPPRESS ) +from textwrap import dedent, wrap from httpie import __doc__, __version__ -from httpie.plugins.builtin import BuiltinAuthPlugin -from httpie.plugins import plugin_manager -from httpie.sessions import DEFAULT_SESSIONS_DIR -from httpie.output.formatters.colors import AVAILABLE_STYLES, DEFAULT_STYLE from httpie.input import ( HTTPieArgumentParser, KeyValueArgType, SEP_PROXY, SEP_GROUP_ALL_ITEMS, @@ -24,6 +20,10 @@ from httpie.input import ( PRETTY_STDOUT_TTY_ONLY, SessionNameValidator, readable_file_arg, SSL_VERSION_ARG_MAPPING ) +from httpie.output.formatters.colors import AVAILABLE_STYLES, DEFAULT_STYLE +from httpie.plugins import plugin_manager +from httpie.plugins.builtin import BuiltinAuthPlugin +from httpie.sessions import DEFAULT_SESSIONS_DIR class HTTPieHelpFormatter(RawDescriptionHelpFormatter): diff --git a/tests/test_auth_plugins.py b/tests/test_auth_plugins.py index 725f0af4..0d0fa26d 100644 --- a/tests/test_auth_plugins.py +++ b/tests/test_auth_plugins.py @@ -1,14 +1,15 @@ from mock import mock -from utils import http, HTTP_OK from httpie.input import SEP_CREDENTIALS from httpie.plugins import AuthPlugin, plugin_manager +from utils import http, HTTP_OK # TODO: run all these tests in session mode as well USERNAME = 'user' PASSWORD = 'password' # Basic auth encoded `USERNAME` and `PASSWORD` +# noinspection SpellCheckingInspection BASIC_AUTH_HEADER_VALUE = 'Basic dXNlcjpwYXNzd29yZA==' BASIC_AUTH_URL = '/basic-auth/{0}/{1}'.format(USERNAME, PASSWORD) AUTH_OK = {'authenticated': True, 'user': USERNAME} diff --git a/tests/test_binary.py b/tests/test_binary.py index 9d4702e9..a76b9cfa 100644 --- a/tests/test_binary.py +++ b/tests/test_binary.py @@ -1,8 +1,8 @@ """Tests for dealing with binary request and response data.""" +from fixtures import BIN_FILE_PATH, BIN_FILE_CONTENT, BIN_FILE_PATH_ARG from httpie.compat import urlopen from httpie.output.streams import BINARY_SUPPRESSED_NOTICE from utils import TestEnvironment, http -from fixtures import BIN_FILE_PATH, BIN_FILE_CONTENT, BIN_FILE_PATH_ARG class TestBinaryRequestData: