diff options
author | Thomas Kriechbaumer <thomas@kriechbaumer.name> | 2016-05-28 14:36:43 +0200 |
---|---|---|
committer | Thomas Kriechbaumer <thomas@kriechbaumer.name> | 2016-05-28 14:43:32 +0200 |
commit | caee1adeb613368dc658bfc0c99e445d6f41cd7c (patch) | |
tree | 5f7ea696349c91266ebec586bd4a273982e92eca /test | |
parent | fa7964988f1541587a9fc3b582223e0a7b11a4d1 (diff) | |
download | mitmproxy-caee1adeb613368dc658bfc0c99e445d6f41cd7c.tar.gz mitmproxy-caee1adeb613368dc658bfc0c99e445d6f41cd7c.tar.bz2 mitmproxy-caee1adeb613368dc658bfc0c99e445d6f41cd7c.zip |
cleanup imports with flake8
Diffstat (limited to 'test')
-rw-r--r-- | test/mitmproxy/test_examples.py | 2 | ||||
-rw-r--r-- | test/mitmproxy/test_flow.py | 1 | ||||
-rw-r--r-- | test/mitmproxy/test_flow_export.py | 1 | ||||
-rw-r--r-- | test/mitmproxy/test_protocol_http2.py | 6 | ||||
-rw-r--r-- | test/mitmproxy/tutils.py | 2 | ||||
-rw-r--r-- | test/netlib/http/http1/test_read.py | 1 | ||||
-rw-r--r-- | test/netlib/http/http2/test_connections.py | 1 | ||||
-rw-r--r-- | test/netlib/http/test_message.py | 4 | ||||
-rw-r--r-- | test/netlib/http/test_response.py | 2 | ||||
-rw-r--r-- | test/netlib/test_socks.py | 1 | ||||
-rw-r--r-- | test/netlib/test_tcp.py | 1 | ||||
-rw-r--r-- | test/netlib/test_version_check.py | 2 | ||||
-rw-r--r-- | test/netlib/websockets/test_websockets.py | 4 | ||||
-rw-r--r-- | test/pathod/test_language_http2.py | 2 | ||||
-rw-r--r-- | test/pathod/test_pathoc.py | 6 | ||||
-rw-r--r-- | test/pathod/test_pathod.py | 2 | ||||
-rw-r--r-- | test/pathod/tutils.py | 5 |
17 files changed, 18 insertions, 25 deletions
diff --git a/test/mitmproxy/test_examples.py b/test/mitmproxy/test_examples.py index c4b06f4b..607d6faf 100644 --- a/test/mitmproxy/test_examples.py +++ b/test/mitmproxy/test_examples.py @@ -3,7 +3,7 @@ import json import os from contextlib import contextmanager -from mitmproxy import utils, script +from mitmproxy import script from mitmproxy.proxy import config import netlib.utils from netlib import tutils as netutils diff --git a/test/mitmproxy/test_flow.py b/test/mitmproxy/test_flow.py index 3e78a5c4..5441ea59 100644 --- a/test/mitmproxy/test_flow.py +++ b/test/mitmproxy/test_flow.py @@ -4,7 +4,6 @@ from six.moves import cStringIO as StringIO import mock import netlib.utils -from netlib import odict from netlib.http import Headers from mitmproxy import filt, controller, tnetstring, flow from mitmproxy.exceptions import FlowReadException, ScriptException diff --git a/test/mitmproxy/test_flow_export.py b/test/mitmproxy/test_flow_export.py index c252c5bd..0374ba7d 100644 --- a/test/mitmproxy/test_flow_export.py +++ b/test/mitmproxy/test_flow_export.py @@ -1,4 +1,3 @@ -import json from textwrap import dedent import re diff --git a/test/mitmproxy/test_protocol_http2.py b/test/mitmproxy/test_protocol_http2.py index c3950975..1e9c62d9 100644 --- a/test/mitmproxy/test_protocol_http2.py +++ b/test/mitmproxy/test_protocol_http2.py @@ -2,7 +2,6 @@ from __future__ import (absolute_import, print_function, division) -import OpenSSL import pytest import traceback import os @@ -468,13 +467,10 @@ class TestConnectionLost(_Http2TestBase, _Http2ServerBase): ]) done = False - ended_streams = 0 - pushed_streams = 0 - responses = 0 while not done: try: raw = b''.join(http2_read_raw_frame(client.rfile)) - events = h2_conn.receive_data(raw) + h2_conn.receive_data(raw) except: break client.wfile.write(h2_conn.data_to_send()) diff --git a/test/mitmproxy/tutils.py b/test/mitmproxy/tutils.py index 118f849c..c1b258a2 100644 --- a/test/mitmproxy/tutils.py +++ b/test/mitmproxy/tutils.py @@ -12,7 +12,7 @@ from unittest.case import SkipTest import netlib.utils import netlib.tutils -from mitmproxy import utils, controller +from mitmproxy import controller from mitmproxy.models import ( ClientConnection, ServerConnection, Error, HTTPRequest, HTTPResponse, HTTPFlow, TCPFlow ) diff --git a/test/netlib/http/http1/test_read.py b/test/netlib/http/http1/test_read.py index d8106904..33f3802b 100644 --- a/test/netlib/http/http1/test_read.py +++ b/test/netlib/http/http1/test_read.py @@ -1,6 +1,5 @@ from __future__ import absolute_import, print_function, division from io import BytesIO -import textwrap from mock import Mock from netlib.exceptions import HttpException, HttpSyntaxException, HttpReadDisconnect, TcpDisconnect from netlib.http import Headers diff --git a/test/netlib/http/http2/test_connections.py b/test/netlib/http/http2/test_connections.py index 7d240c0e..9312576f 100644 --- a/test/netlib/http/http2/test_connections.py +++ b/test/netlib/http/http2/test_connections.py @@ -1,4 +1,3 @@ -import OpenSSL import mock import codecs diff --git a/test/netlib/http/test_message.py b/test/netlib/http/test_message.py index 64592921..f5bf7f0c 100644 --- a/test/netlib/http/test_message.py +++ b/test/netlib/http/test_message.py @@ -1,8 +1,8 @@ # -*- coding: utf-8 -*- from __future__ import absolute_import, print_function, division -from netlib.http import decoded, Headers -from netlib.tutils import tresp, raises +from netlib.http import decoded +from netlib.tutils import tresp def _test_passthrough_attr(message, attr): diff --git a/test/netlib/http/test_response.py b/test/netlib/http/test_response.py index cfd093d4..63c976a2 100644 --- a/test/netlib/http/test_response.py +++ b/test/netlib/http/test_response.py @@ -2,12 +2,10 @@ from __future__ import absolute_import, print_function, division import email -import six import time from netlib.http import Headers from netlib.http.cookies import CookieAttrs -from netlib.odict import ODict, ODictCaseless from netlib.tutils import raises, tresp from .test_message import _test_passthrough_attr, _test_decoded_attr diff --git a/test/netlib/test_socks.py b/test/netlib/test_socks.py index 486b975b..17e08054 100644 --- a/test/netlib/test_socks.py +++ b/test/netlib/test_socks.py @@ -1,6 +1,5 @@ import ipaddress from io import BytesIO -import socket from netlib import socks, tcp, tutils diff --git a/test/netlib/test_tcp.py b/test/netlib/test_tcp.py index 4b4bbb92..80cdba36 100644 --- a/test/netlib/test_tcp.py +++ b/test/netlib/test_tcp.py @@ -8,7 +8,6 @@ import threading import mock from OpenSSL import SSL -import OpenSSL from netlib import tcp, certutils, tutils from netlib.exceptions import InvalidCertificateException, TcpReadIncomplete, TlsException, \ diff --git a/test/netlib/test_version_check.py b/test/netlib/test_version_check.py index 680f80e0..fa6b19e5 100644 --- a/test/netlib/test_version_check.py +++ b/test/netlib/test_version_check.py @@ -1,6 +1,6 @@ from io import StringIO import mock -from netlib import version_check, version +from netlib import version_check @mock.patch("sys.exit") diff --git a/test/netlib/websockets/test_websockets.py b/test/netlib/websockets/test_websockets.py index a7d782a4..4a6f0f9b 100644 --- a/test/netlib/websockets/test_websockets.py +++ b/test/netlib/websockets/test_websockets.py @@ -2,7 +2,9 @@ import os from netlib.http.http1 import read_response, read_request -from netlib import tcp, websockets, http, tutils +from netlib import tcp +from netlib import tutils +from netlib import websockets from netlib.http import status_codes from netlib.tutils import treq from netlib.exceptions import * diff --git a/test/pathod/test_language_http2.py b/test/pathod/test_language_http2.py index abfe4606..4acde3af 100644 --- a/test/pathod/test_language_http2.py +++ b/test/pathod/test_language_http2.py @@ -5,7 +5,7 @@ from netlib import tcp from netlib.http import user_agents from pathod import language -from pathod.language import http2, base +from pathod.language import http2 import tutils diff --git a/test/pathod/test_pathoc.py b/test/pathod/test_pathoc.py index 4e8c89c5..e7818772 100644 --- a/test/pathod/test_pathoc.py +++ b/test/pathod/test_pathoc.py @@ -1,12 +1,12 @@ import json from six.moves import cStringIO as StringIO import re -import OpenSSL import pytest from mock import Mock -from netlib import tcp, http, socks -from netlib.exceptions import HttpException, TcpException, NetlibException +from netlib import http +from netlib import tcp +from netlib.exceptions import NetlibException from netlib.http import http1, http2 from pathod import pathoc, test, version, pathod, language diff --git a/test/pathod/test_pathod.py b/test/pathod/test_pathod.py index 05a3962e..13b36e36 100644 --- a/test/pathod/test_pathod.py +++ b/test/pathod/test_pathod.py @@ -2,7 +2,7 @@ from six.moves import cStringIO as StringIO import pytest from pathod import pathod, version -from netlib import tcp, http +from netlib import tcp from netlib.exceptions import HttpException, TlsException import tutils diff --git a/test/pathod/tutils.py b/test/pathod/tutils.py index f6ed3efb..d6b7bc1a 100644 --- a/test/pathod/tutils.py +++ b/test/pathod/tutils.py @@ -4,7 +4,10 @@ import shutil from six.moves import cStringIO as StringIO import netlib -from pathod import utils, test, pathoc, pathod, language +from pathod import language +from pathod import pathoc +from pathod import pathod +from pathod import test from netlib import tcp import requests |