aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/mitmproxy/net/__init__.py (renamed from test/netlib/__init__.py)0
-rw-r--r--test/mitmproxy/net/data/clientcert/.gitignore (renamed from test/netlib/data/clientcert/.gitignore)0
-rw-r--r--test/mitmproxy/net/data/clientcert/client.cnf (renamed from test/netlib/data/clientcert/client.cnf)0
-rw-r--r--test/mitmproxy/net/data/clientcert/client.pem (renamed from test/netlib/data/clientcert/client.pem)0
-rw-r--r--test/mitmproxy/net/data/clientcert/make (renamed from test/netlib/data/clientcert/make)0
-rw-r--r--test/mitmproxy/net/data/dercert (renamed from test/netlib/data/dercert)bin1838 -> 1838 bytes
-rw-r--r--test/mitmproxy/net/data/dhparam.pem (renamed from test/netlib/data/dhparam.pem)0
-rw-r--r--test/mitmproxy/net/data/htpasswd (renamed from test/netlib/data/htpasswd)0
-rw-r--r--test/mitmproxy/net/data/server.crt (renamed from test/netlib/data/server.crt)0
-rw-r--r--test/mitmproxy/net/data/server.key (renamed from test/netlib/data/server.key)0
-rw-r--r--test/mitmproxy/net/data/text_cert (renamed from test/netlib/data/text_cert)0
-rw-r--r--test/mitmproxy/net/data/text_cert_2 (renamed from test/netlib/data/text_cert_2)0
-rw-r--r--test/mitmproxy/net/data/text_cert_weird1 (renamed from test/netlib/data/text_cert_weird1)0
-rw-r--r--test/mitmproxy/net/data/verificationcerts/9da13359.0 (renamed from test/netlib/data/verificationcerts/9da13359.0)0
-rw-r--r--test/mitmproxy/net/data/verificationcerts/generate.py (renamed from test/netlib/data/verificationcerts/generate.py)0
-rw-r--r--test/mitmproxy/net/data/verificationcerts/self-signed.crt (renamed from test/netlib/data/verificationcerts/self-signed.crt)0
-rw-r--r--test/mitmproxy/net/data/verificationcerts/self-signed.key (renamed from test/netlib/data/verificationcerts/self-signed.key)0
-rw-r--r--test/mitmproxy/net/data/verificationcerts/trusted-leaf.crt (renamed from test/netlib/data/verificationcerts/trusted-leaf.crt)0
-rw-r--r--test/mitmproxy/net/data/verificationcerts/trusted-leaf.key (renamed from test/netlib/data/verificationcerts/trusted-leaf.key)0
-rw-r--r--test/mitmproxy/net/data/verificationcerts/trusted-root.crt (renamed from test/netlib/data/verificationcerts/trusted-root.crt)0
-rw-r--r--test/mitmproxy/net/data/verificationcerts/trusted-root.key (renamed from test/netlib/data/verificationcerts/trusted-root.key)0
-rw-r--r--test/mitmproxy/net/data/verificationcerts/trusted-root.srl (renamed from test/netlib/data/verificationcerts/trusted-root.srl)0
-rw-r--r--test/mitmproxy/net/http/__init__.py (renamed from test/netlib/http/__init__.py)0
-rw-r--r--test/mitmproxy/net/http/http1/__init__.py (renamed from test/netlib/http/http1/__init__.py)0
-rw-r--r--test/mitmproxy/net/http/http1/test_assemble.py (renamed from test/netlib/http/http1/test_assemble.py)4
-rw-r--r--test/mitmproxy/net/http/http1/test_read.py (renamed from test/netlib/http/http1/test_read.py)4
-rw-r--r--test/mitmproxy/net/http/http2/__init__.py (renamed from test/netlib/http/http2/__init__.py)0
-rw-r--r--test/mitmproxy/net/http/http2/test_framereader.py (renamed from test/netlib/http/http2/test_framereader.py)0
-rw-r--r--test/mitmproxy/net/http/test_authentication.py (renamed from test/netlib/http/test_authentication.py)2
-rw-r--r--test/mitmproxy/net/http/test_cookies.py (renamed from test/netlib/http/test_cookies.py)2
-rw-r--r--test/mitmproxy/net/http/test_encoding.py (renamed from test/netlib/http/test_encoding.py)2
-rw-r--r--test/mitmproxy/net/http/test_headers.py (renamed from test/netlib/http/test_headers.py)2
-rw-r--r--test/mitmproxy/net/http/test_message.py (renamed from test/netlib/http/test_message.py)2
-rw-r--r--test/mitmproxy/net/http/test_multipart.py (renamed from test/netlib/http/test_multipart.py)4
-rw-r--r--test/mitmproxy/net/http/test_request.py (renamed from test/netlib/http/test_request.py)2
-rw-r--r--test/mitmproxy/net/http/test_response.py (renamed from test/netlib/http/test_response.py)6
-rw-r--r--test/mitmproxy/net/http/test_status_codes.py (renamed from test/netlib/http/test_status_codes.py)2
-rw-r--r--test/mitmproxy/net/http/test_url.py (renamed from test/netlib/http/test_url.py)2
-rw-r--r--test/mitmproxy/net/http/test_user_agents.py (renamed from test/netlib/http/test_user_agents.py)2
-rw-r--r--test/mitmproxy/net/test_check.py (renamed from test/netlib/test_check.py)2
-rw-r--r--test/mitmproxy/net/test_imports.py (renamed from test/netlib/test_imports.py)0
-rw-r--r--test/mitmproxy/net/test_socks.py (renamed from test/netlib/test_socks.py)4
-rw-r--r--test/mitmproxy/net/test_tcp.py (renamed from test/netlib/test_tcp.py)2
-rw-r--r--test/mitmproxy/net/test_wsgi.py (renamed from test/netlib/test_wsgi.py)4
-rw-r--r--test/mitmproxy/net/tools/getcertnames (renamed from test/netlib/tools/getcertnames)2
-rw-r--r--test/mitmproxy/net/tservers.py (renamed from test/netlib/tservers.py)2
-rw-r--r--test/mitmproxy/net/websockets/__init__.py (renamed from test/netlib/websockets/__init__.py)0
-rw-r--r--test/mitmproxy/net/websockets/test_frame.py (renamed from test/netlib/websockets/test_frame.py)2
-rw-r--r--test/mitmproxy/net/websockets/test_masker.py (renamed from test/netlib/websockets/test_masker.py)2
-rw-r--r--test/mitmproxy/net/websockets/test_utils.py (renamed from test/netlib/websockets/test_utils.py)4
-rw-r--r--test/mitmproxy/protocol/test_http1.py4
-rw-r--r--test/mitmproxy/protocol/test_http2.py16
-rw-r--r--test/mitmproxy/protocol/test_websockets.py14
-rw-r--r--test/mitmproxy/test_contentview.py4
-rw-r--r--test/mitmproxy/test_custom_contentview.py2
-rw-r--r--test/mitmproxy/test_examples.py4
-rw-r--r--test/mitmproxy/test_flow.py2
-rw-r--r--test/mitmproxy/test_flow_export.py2
-rw-r--r--test/mitmproxy/test_proxy.py2
-rw-r--r--test/mitmproxy/test_server.py18
-rw-r--r--test/pathod/test_language_http2.py4
-rw-r--r--test/pathod/test_language_websocket.py12
-rw-r--r--test/pathod/test_pathoc.py6
-rw-r--r--test/pathod/test_pathod.py2
-rw-r--r--test/pathod/test_protocols_http2.py26
-rw-r--r--test/pathod/tutils.py2
66 files changed, 90 insertions, 90 deletions
diff --git a/test/netlib/__init__.py b/test/mitmproxy/net/__init__.py
index e69de29b..e69de29b 100644
--- a/test/netlib/__init__.py
+++ b/test/mitmproxy/net/__init__.py
diff --git a/test/netlib/data/clientcert/.gitignore b/test/mitmproxy/net/data/clientcert/.gitignore
index 07bc53d2..07bc53d2 100644
--- a/test/netlib/data/clientcert/.gitignore
+++ b/test/mitmproxy/net/data/clientcert/.gitignore
diff --git a/test/netlib/data/clientcert/client.cnf b/test/mitmproxy/net/data/clientcert/client.cnf
index 5046a944..5046a944 100644
--- a/test/netlib/data/clientcert/client.cnf
+++ b/test/mitmproxy/net/data/clientcert/client.cnf
diff --git a/test/netlib/data/clientcert/client.pem b/test/mitmproxy/net/data/clientcert/client.pem
index 4927bca2..4927bca2 100644
--- a/test/netlib/data/clientcert/client.pem
+++ b/test/mitmproxy/net/data/clientcert/client.pem
diff --git a/test/netlib/data/clientcert/make b/test/mitmproxy/net/data/clientcert/make
index d1caea81..d1caea81 100644
--- a/test/netlib/data/clientcert/make
+++ b/test/mitmproxy/net/data/clientcert/make
diff --git a/test/netlib/data/dercert b/test/mitmproxy/net/data/dercert
index 370252af..370252af 100644
--- a/test/netlib/data/dercert
+++ b/test/mitmproxy/net/data/dercert
Binary files differ
diff --git a/test/netlib/data/dhparam.pem b/test/mitmproxy/net/data/dhparam.pem
index afb41672..afb41672 100644
--- a/test/netlib/data/dhparam.pem
+++ b/test/mitmproxy/net/data/dhparam.pem
diff --git a/test/netlib/data/htpasswd b/test/mitmproxy/net/data/htpasswd
index 54c95b8c..54c95b8c 100644
--- a/test/netlib/data/htpasswd
+++ b/test/mitmproxy/net/data/htpasswd
diff --git a/test/netlib/data/server.crt b/test/mitmproxy/net/data/server.crt
index 68f61bac..68f61bac 100644
--- a/test/netlib/data/server.crt
+++ b/test/mitmproxy/net/data/server.crt
diff --git a/test/netlib/data/server.key b/test/mitmproxy/net/data/server.key
index b1b658ab..b1b658ab 100644
--- a/test/netlib/data/server.key
+++ b/test/mitmproxy/net/data/server.key
diff --git a/test/netlib/data/text_cert b/test/mitmproxy/net/data/text_cert
index 36ca33b9..36ca33b9 100644
--- a/test/netlib/data/text_cert
+++ b/test/mitmproxy/net/data/text_cert
diff --git a/test/netlib/data/text_cert_2 b/test/mitmproxy/net/data/text_cert_2
index ffe8faae..ffe8faae 100644
--- a/test/netlib/data/text_cert_2
+++ b/test/mitmproxy/net/data/text_cert_2
diff --git a/test/netlib/data/text_cert_weird1 b/test/mitmproxy/net/data/text_cert_weird1
index 72b09dcb..72b09dcb 100644
--- a/test/netlib/data/text_cert_weird1
+++ b/test/mitmproxy/net/data/text_cert_weird1
diff --git a/test/netlib/data/verificationcerts/9da13359.0 b/test/mitmproxy/net/data/verificationcerts/9da13359.0
index b22e4d20..b22e4d20 100644
--- a/test/netlib/data/verificationcerts/9da13359.0
+++ b/test/mitmproxy/net/data/verificationcerts/9da13359.0
diff --git a/test/netlib/data/verificationcerts/generate.py b/test/mitmproxy/net/data/verificationcerts/generate.py
index 6d4d8550..6d4d8550 100644
--- a/test/netlib/data/verificationcerts/generate.py
+++ b/test/mitmproxy/net/data/verificationcerts/generate.py
diff --git a/test/netlib/data/verificationcerts/self-signed.crt b/test/mitmproxy/net/data/verificationcerts/self-signed.crt
index dce2a7e0..dce2a7e0 100644
--- a/test/netlib/data/verificationcerts/self-signed.crt
+++ b/test/mitmproxy/net/data/verificationcerts/self-signed.crt
diff --git a/test/netlib/data/verificationcerts/self-signed.key b/test/mitmproxy/net/data/verificationcerts/self-signed.key
index 71a6ad6a..71a6ad6a 100644
--- a/test/netlib/data/verificationcerts/self-signed.key
+++ b/test/mitmproxy/net/data/verificationcerts/self-signed.key
diff --git a/test/netlib/data/verificationcerts/trusted-leaf.crt b/test/mitmproxy/net/data/verificationcerts/trusted-leaf.crt
index 6a92de92..6a92de92 100644
--- a/test/netlib/data/verificationcerts/trusted-leaf.crt
+++ b/test/mitmproxy/net/data/verificationcerts/trusted-leaf.crt
diff --git a/test/netlib/data/verificationcerts/trusted-leaf.key b/test/mitmproxy/net/data/verificationcerts/trusted-leaf.key
index 783ebf1c..783ebf1c 100644
--- a/test/netlib/data/verificationcerts/trusted-leaf.key
+++ b/test/mitmproxy/net/data/verificationcerts/trusted-leaf.key
diff --git a/test/netlib/data/verificationcerts/trusted-root.crt b/test/mitmproxy/net/data/verificationcerts/trusted-root.crt
index b22e4d20..b22e4d20 100644
--- a/test/netlib/data/verificationcerts/trusted-root.crt
+++ b/test/mitmproxy/net/data/verificationcerts/trusted-root.crt
diff --git a/test/netlib/data/verificationcerts/trusted-root.key b/test/mitmproxy/net/data/verificationcerts/trusted-root.key
index 05483f77..05483f77 100644
--- a/test/netlib/data/verificationcerts/trusted-root.key
+++ b/test/mitmproxy/net/data/verificationcerts/trusted-root.key
diff --git a/test/netlib/data/verificationcerts/trusted-root.srl b/test/mitmproxy/net/data/verificationcerts/trusted-root.srl
index 4ad962ba..4ad962ba 100644
--- a/test/netlib/data/verificationcerts/trusted-root.srl
+++ b/test/mitmproxy/net/data/verificationcerts/trusted-root.srl
diff --git a/test/netlib/http/__init__.py b/test/mitmproxy/net/http/__init__.py
index e69de29b..e69de29b 100644
--- a/test/netlib/http/__init__.py
+++ b/test/mitmproxy/net/http/__init__.py
diff --git a/test/netlib/http/http1/__init__.py b/test/mitmproxy/net/http/http1/__init__.py
index e69de29b..e69de29b 100644
--- a/test/netlib/http/http1/__init__.py
+++ b/test/mitmproxy/net/http/http1/__init__.py
diff --git a/test/netlib/http/http1/test_assemble.py b/test/mitmproxy/net/http/http1/test_assemble.py
index dac5fdad..e80376e8 100644
--- a/test/netlib/http/http1/test_assemble.py
+++ b/test/mitmproxy/net/http/http1/test_assemble.py
@@ -1,6 +1,6 @@
from mitmproxy import exceptions
-from netlib.http import Headers
-from netlib.http.http1.assemble import (
+from mitmproxy.net.http import Headers
+from mitmproxy.net.http.http1.assemble import (
assemble_request, assemble_request_head, assemble_response,
assemble_response_head, _assemble_request_line, _assemble_request_headers,
_assemble_response_headers,
diff --git a/test/netlib/http/http1/test_read.py b/test/mitmproxy/net/http/http1/test_read.py
index eb96968c..20997259 100644
--- a/test/netlib/http/http1/test_read.py
+++ b/test/mitmproxy/net/http/http1/test_read.py
@@ -3,8 +3,8 @@ from mock import Mock
import pytest
from mitmproxy import exceptions
-from netlib.http import Headers
-from netlib.http.http1.read import (
+from mitmproxy.net.http import Headers
+from mitmproxy.net.http.http1.read import (
read_request, read_response, read_request_head,
read_response_head, read_body, connection_close, expected_http_body_size, _get_first_line,
_read_request_line, _parse_authority_form, _read_response_line, _check_http_version,
diff --git a/test/netlib/http/http2/__init__.py b/test/mitmproxy/net/http/http2/__init__.py
index e69de29b..e69de29b 100644
--- a/test/netlib/http/http2/__init__.py
+++ b/test/mitmproxy/net/http/http2/__init__.py
diff --git a/test/netlib/http/http2/test_framereader.py b/test/mitmproxy/net/http/http2/test_framereader.py
index 41b73189..41b73189 100644
--- a/test/netlib/http/http2/test_framereader.py
+++ b/test/mitmproxy/net/http/http2/test_framereader.py
diff --git a/test/netlib/http/test_authentication.py b/test/mitmproxy/net/http/test_authentication.py
index 5e04bbc5..11b6e2e0 100644
--- a/test/netlib/http/test_authentication.py
+++ b/test/mitmproxy/net/http/test_authentication.py
@@ -1,7 +1,7 @@
import binascii
from mitmproxy.test import tutils
-from netlib.http import authentication, Headers
+from mitmproxy.net.http import authentication, Headers
def test_parse_http_basic_auth():
diff --git a/test/netlib/http/test_cookies.py b/test/mitmproxy/net/http/test_cookies.py
index ca10a69c..8c9c0c32 100644
--- a/test/netlib/http/test_cookies.py
+++ b/test/mitmproxy/net/http/test_cookies.py
@@ -1,6 +1,6 @@
import time
-from netlib.http import cookies
+from mitmproxy.net.http import cookies
from mitmproxy.test.tutils import raises
import mock
diff --git a/test/netlib/http/test_encoding.py b/test/mitmproxy/net/http/test_encoding.py
index 89600709..d8fa5e76 100644
--- a/test/netlib/http/test_encoding.py
+++ b/test/mitmproxy/net/http/test_encoding.py
@@ -1,7 +1,7 @@
import mock
import pytest
-from netlib.http import encoding
+from mitmproxy.net.http import encoding
from mitmproxy.test import tutils
diff --git a/test/netlib/http/test_headers.py b/test/mitmproxy/net/http/test_headers.py
index cac77d57..8e0f770d 100644
--- a/test/netlib/http/test_headers.py
+++ b/test/mitmproxy/net/http/test_headers.py
@@ -1,6 +1,6 @@
import collections
-from netlib.http.headers import Headers, parse_content_type, assemble_content_type
+from mitmproxy.net.http.headers import Headers, parse_content_type, assemble_content_type
from mitmproxy.test.tutils import raises
diff --git a/test/netlib/http/test_message.py b/test/mitmproxy/net/http/test_message.py
index 2bc8824f..69d029d9 100644
--- a/test/netlib/http/test_message.py
+++ b/test/mitmproxy/net/http/test_message.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
from mitmproxy.test import tutils
-from netlib import http
+from mitmproxy.net import http
def _test_passthrough_attr(message, attr):
diff --git a/test/netlib/http/test_multipart.py b/test/mitmproxy/net/http/test_multipart.py
index 1d7e0062..68ae6bbd 100644
--- a/test/netlib/http/test_multipart.py
+++ b/test/mitmproxy/net/http/test_multipart.py
@@ -1,5 +1,5 @@
-from netlib.http import Headers
-from netlib.http import multipart
+from mitmproxy.net.http import Headers
+from mitmproxy.net.http import multipart
def test_decode():
diff --git a/test/netlib/http/test_request.py b/test/mitmproxy/net/http/test_request.py
index ecfc1ba6..9c0ec333 100644
--- a/test/netlib/http/test_request.py
+++ b/test/mitmproxy/net/http/test_request.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-from netlib.http import Headers
+from mitmproxy.net.http import Headers
from mitmproxy.test.tutils import treq, raises
from .test_message import _test_decoded_attr, _test_passthrough_attr
diff --git a/test/netlib/http/test_response.py b/test/mitmproxy/net/http/test_response.py
index 4a6fac62..239fb6ef 100644
--- a/test/netlib/http/test_response.py
+++ b/test/mitmproxy/net/http/test_response.py
@@ -2,9 +2,9 @@ import email
import time
-from netlib.http import Headers
-from netlib.http import Response
-from netlib.http.cookies import CookieAttrs
+from mitmproxy.net.http import Headers
+from mitmproxy.net.http import Response
+from mitmproxy.net.http.cookies import CookieAttrs
from mitmproxy.test.tutils import raises, tresp
from .test_message import _test_passthrough_attr, _test_decoded_attr
diff --git a/test/netlib/http/test_status_codes.py b/test/mitmproxy/net/http/test_status_codes.py
index 9fea6b70..098f8eef 100644
--- a/test/netlib/http/test_status_codes.py
+++ b/test/mitmproxy/net/http/test_status_codes.py
@@ -1,4 +1,4 @@
-from netlib.http import status_codes
+from mitmproxy.net.http import status_codes
def test_simple():
diff --git a/test/netlib/http/test_url.py b/test/mitmproxy/net/http/test_url.py
index 7cea6c58..94b2eacc 100644
--- a/test/netlib/http/test_url.py
+++ b/test/mitmproxy/net/http/test_url.py
@@ -1,5 +1,5 @@
from mitmproxy.test import tutils
-from netlib.http import url
+from mitmproxy.net.http import url
def test_parse():
diff --git a/test/netlib/http/test_user_agents.py b/test/mitmproxy/net/http/test_user_agents.py
index 0bf1bba7..9e391447 100644
--- a/test/netlib/http/test_user_agents.py
+++ b/test/mitmproxy/net/http/test_user_agents.py
@@ -1,4 +1,4 @@
-from netlib.http import user_agents
+from mitmproxy.net.http import user_agents
def test_get_shortcut():
diff --git a/test/netlib/test_check.py b/test/mitmproxy/net/test_check.py
index 6a1388f4..18a50157 100644
--- a/test/netlib/test_check.py
+++ b/test/mitmproxy/net/test_check.py
@@ -1,6 +1,6 @@
# coding=utf-8
-from netlib import check
+from mitmproxy.net import check
def test_is_valid_host():
diff --git a/test/netlib/test_imports.py b/test/mitmproxy/net/test_imports.py
index b88ef26d..b88ef26d 100644
--- a/test/netlib/test_imports.py
+++ b/test/mitmproxy/net/test_imports.py
diff --git a/test/netlib/test_socks.py b/test/mitmproxy/net/test_socks.py
index 0603f34b..b6551faa 100644
--- a/test/netlib/test_socks.py
+++ b/test/mitmproxy/net/test_socks.py
@@ -1,7 +1,7 @@
import ipaddress
from io import BytesIO
-from netlib import socks
-from netlib import tcp
+from mitmproxy.net import socks
+from mitmproxy.net import tcp
from mitmproxy.test import tutils
diff --git a/test/netlib/test_tcp.py b/test/mitmproxy/net/test_tcp.py
index 594ee21c..8a7c692a 100644
--- a/test/netlib/test_tcp.py
+++ b/test/mitmproxy/net/test_tcp.py
@@ -10,7 +10,7 @@ import mock
from OpenSSL import SSL
from mitmproxy import certs
-from netlib import tcp
+from mitmproxy.net import tcp
from mitmproxy.test import tutils
from mitmproxy import exceptions
diff --git a/test/netlib/test_wsgi.py b/test/mitmproxy/net/test_wsgi.py
index 5c61f81c..b4d6b53f 100644
--- a/test/netlib/test_wsgi.py
+++ b/test/mitmproxy/net/test_wsgi.py
@@ -1,7 +1,7 @@
from io import BytesIO
import sys
-from netlib import wsgi
-from netlib.http import Headers
+from mitmproxy.net import wsgi
+from mitmproxy.net.http import Headers
def tflow():
diff --git a/test/netlib/tools/getcertnames b/test/mitmproxy/net/tools/getcertnames
index 0882fccd..d64e5ff5 100644
--- a/test/netlib/tools/getcertnames
+++ b/test/mitmproxy/net/tools/getcertnames
@@ -1,7 +1,7 @@
#!/usr/bin/env python
import sys
sys.path.insert(0, "../../")
-from netlib import tcp
+from mitmproxy.net import tcp
def get_remote_cert(host, port, sni):
diff --git a/test/netlib/tservers.py b/test/mitmproxy/net/tservers.py
index 2fae8ba6..ba10ef5e 100644
--- a/test/netlib/tservers.py
+++ b/test/mitmproxy/net/tservers.py
@@ -3,7 +3,7 @@ import queue
import io
import OpenSSL
-from netlib import tcp
+from mitmproxy.net import tcp
from mitmproxy.test import tutils
diff --git a/test/netlib/websockets/__init__.py b/test/mitmproxy/net/websockets/__init__.py
index e69de29b..e69de29b 100644
--- a/test/netlib/websockets/__init__.py
+++ b/test/mitmproxy/net/websockets/__init__.py
diff --git a/test/netlib/websockets/test_frame.py b/test/mitmproxy/net/websockets/test_frame.py
index 3b7c9ed4..198be3d5 100644
--- a/test/netlib/websockets/test_frame.py
+++ b/test/mitmproxy/net/websockets/test_frame.py
@@ -2,7 +2,7 @@ import os
import codecs
import pytest
-from netlib import websockets
+from mitmproxy.net import websockets
from mitmproxy.test import tutils
diff --git a/test/netlib/websockets/test_masker.py b/test/mitmproxy/net/websockets/test_masker.py
index 23a9b876..88360c3b 100644
--- a/test/netlib/websockets/test_masker.py
+++ b/test/mitmproxy/net/websockets/test_masker.py
@@ -1,7 +1,7 @@
import codecs
import pytest
-from netlib import websockets
+from mitmproxy.net import websockets
class TestMasker:
diff --git a/test/netlib/websockets/test_utils.py b/test/mitmproxy/net/websockets/test_utils.py
index f6f1e40a..6704d39d 100644
--- a/test/netlib/websockets/test_utils.py
+++ b/test/mitmproxy/net/websockets/test_utils.py
@@ -1,7 +1,7 @@
import pytest
-from netlib import http
-from netlib import websockets
+from mitmproxy.net import http
+from mitmproxy.net import websockets
class TestUtils:
diff --git a/test/mitmproxy/protocol/test_http1.py b/test/mitmproxy/protocol/test_http1.py
index d18ff411..43c903f3 100644
--- a/test/mitmproxy/protocol/test_http1.py
+++ b/test/mitmproxy/protocol/test_http1.py
@@ -1,5 +1,5 @@
-from netlib.http import http1
-from netlib.tcp import TCPClient
+from mitmproxy.net.http import http1
+from mitmproxy.net.tcp import TCPClient
from mitmproxy.test.tutils import treq
from .. import tutils, tservers
diff --git a/test/mitmproxy/protocol/test_http2.py b/test/mitmproxy/protocol/test_http2.py
index b624489f..4629d109 100644
--- a/test/mitmproxy/protocol/test_http2.py
+++ b/test/mitmproxy/protocol/test_http2.py
@@ -11,10 +11,10 @@ import h2
from mitmproxy import options
from mitmproxy.proxy.config import ProxyConfig
-import netlib
-from ...netlib import tservers as netlib_tservers
+import mitmproxy.net
+from ...mitmproxy.net import tservers as net_tservers
from mitmproxy import exceptions
-from netlib.http import http1, http2
+from mitmproxy.net.http import http1, http2
from .. import tservers
@@ -28,7 +28,7 @@ logging.getLogger("PIL.PngImagePlugin").setLevel(logging.WARNING)
requires_alpn = pytest.mark.skipif(
- not netlib.tcp.HAS_ALPN,
+ not mitmproxy.net.tcp.HAS_ALPN,
reason='requires OpenSSL with ALPN support')
@@ -37,10 +37,10 @@ requires_alpn = pytest.mark.skipif(
# print(msg)
-class _Http2ServerBase(netlib_tservers.ServerTestBase):
+class _Http2ServerBase(net_tservers.ServerTestBase):
ssl = dict(alpn_select=b'h2')
- class handler(netlib.tcp.BaseHandler):
+ class handler(mitmproxy.net.tcp.BaseHandler):
def handle(self):
h2_conn = h2.connection.H2Connection(client_side=False, header_encoding=False)
@@ -122,11 +122,11 @@ class _Http2TestBase:
self.server.server.handle_server_event = self.handle_server_event
def _setup_connection(self):
- client = netlib.tcp.TCPClient(("127.0.0.1", self.proxy.port))
+ client = mitmproxy.net.tcp.TCPClient(("127.0.0.1", self.proxy.port))
client.connect()
# send CONNECT request
- client.wfile.write(http1.assemble_request(netlib.http.Request(
+ client.wfile.write(http1.assemble_request(mitmproxy.net.http.Request(
'authority',
b'CONNECT',
b'',
diff --git a/test/mitmproxy/protocol/test_websockets.py b/test/mitmproxy/protocol/test_websockets.py
index f22e95d5..71cbb5f4 100644
--- a/test/mitmproxy/protocol/test_websockets.py
+++ b/test/mitmproxy/protocol/test_websockets.py
@@ -7,17 +7,17 @@ from mitmproxy import options
from mitmproxy import exceptions
from mitmproxy.proxy.config import ProxyConfig
-import netlib
-from netlib import http
-from ...netlib import tservers as netlib_tservers
+import mitmproxy.net
+from mitmproxy.net import http
+from ...mitmproxy.net import tservers as net_tservers
from .. import tservers
-from netlib import websockets
+from mitmproxy.net import websockets
-class _WebSocketsServerBase(netlib_tservers.ServerTestBase):
+class _WebSocketsServerBase(net_tservers.ServerTestBase):
- class handler(netlib.tcp.BaseHandler):
+ class handler(mitmproxy.net.tcp.BaseHandler):
def handle(self):
try:
@@ -78,7 +78,7 @@ class _WebSocketsTestBase:
self.server.server.handle_websockets = self.handle_websockets
def _setup_connection(self):
- client = netlib.tcp.TCPClient(("127.0.0.1", self.proxy.port))
+ client = mitmproxy.net.tcp.TCPClient(("127.0.0.1", self.proxy.port))
client.connect()
request = http.Request(
diff --git a/test/mitmproxy/test_contentview.py b/test/mitmproxy/test_contentview.py
index 2c5e1c85..b0e77ce1 100644
--- a/test/mitmproxy/test_contentview.py
+++ b/test/mitmproxy/test_contentview.py
@@ -1,7 +1,7 @@
import mock
from mitmproxy.exceptions import ContentViewException
-from netlib.http import Headers
-from netlib.http import url
+from mitmproxy.net.http import Headers
+from mitmproxy.net.http import url
from mitmproxy.types import multidict
import mitmproxy.contentviews as cv
diff --git a/test/mitmproxy/test_custom_contentview.py b/test/mitmproxy/test_custom_contentview.py
index 889fb8b3..28f7fb33 100644
--- a/test/mitmproxy/test_custom_contentview.py
+++ b/test/mitmproxy/test_custom_contentview.py
@@ -1,5 +1,5 @@
import mitmproxy.contentviews as cv
-from netlib.http import Headers
+from mitmproxy.net.http import Headers
def test_custom_views():
diff --git a/test/mitmproxy/test_examples.py b/test/mitmproxy/test_examples.py
index 48193fe7..6972da0c 100644
--- a/test/mitmproxy/test_examples.py
+++ b/test/mitmproxy/test_examples.py
@@ -10,8 +10,8 @@ from mitmproxy.utils import data
from mitmproxy import master
from mitmproxy.test import tutils as netutils
-from netlib.http import Headers
-from netlib.http import cookies
+from mitmproxy.net.http import Headers
+from mitmproxy.net.http import cookies
from . import tutils, mastertest
diff --git a/test/mitmproxy/test_flow.py b/test/mitmproxy/test_flow.py
index 14899be1..5b9f3835 100644
--- a/test/mitmproxy/test_flow.py
+++ b/test/mitmproxy/test_flow.py
@@ -2,7 +2,7 @@ import mock
import io
import mitmproxy.test.tutils
-from netlib.http import Headers
+from mitmproxy.net.http import Headers
import mitmproxy.io
from mitmproxy import flowfilter, options
from mitmproxy.addons import state
diff --git a/test/mitmproxy/test_flow_export.py b/test/mitmproxy/test_flow_export.py
index 8ef2b7ee..df0ccb77 100644
--- a/test/mitmproxy/test_flow_export.py
+++ b/test/mitmproxy/test_flow_export.py
@@ -1,7 +1,7 @@
import re
import mitmproxy.test.tutils
-from netlib.http import Headers
+from mitmproxy.net.http import Headers
from mitmproxy import export # heh
from . import tutils
diff --git a/test/mitmproxy/test_proxy.py b/test/mitmproxy/test_proxy.py
index c0d978d2..a9d9bb87 100644
--- a/test/mitmproxy/test_proxy.py
+++ b/test/mitmproxy/test_proxy.py
@@ -10,7 +10,7 @@ from mitmproxy.proxy.server import DummyServer, ProxyServer, ConnectionHandler
from mitmproxy.proxy import config
from mitmproxy import exceptions
from pathod import test
-from netlib.http import http1
+from mitmproxy.net.http import http1
from . import tutils
diff --git a/test/mitmproxy/test_server.py b/test/mitmproxy/test_server.py
index f7f13443..7dd738f4 100644
--- a/test/mitmproxy/test_server.py
+++ b/test/mitmproxy/test_server.py
@@ -8,14 +8,14 @@ from mitmproxy import options
from mitmproxy.addons import script
from mitmproxy import http
from mitmproxy.proxy.config import HostMatcher, parse_server_spec
-import netlib.http
-from netlib import tcp
-from netlib import socks
+import mitmproxy.net.http
+from mitmproxy.net import tcp
+from mitmproxy.net import socks
from mitmproxy import certs
from mitmproxy import exceptions
-from netlib.http import authentication
-from netlib.http import http1
-from netlib.tcp import Address
+from mitmproxy.net.http import authentication
+from mitmproxy.net.http import http1
+from mitmproxy.net.tcp import Address
from mitmproxy.test.tutils import raises
from pathod import pathoc
from pathod import pathod
@@ -297,7 +297,7 @@ class TestHTTPAuth(tservers.HTTPProxyTest):
h'%s'='%s'
""" % (
self.server.port,
- netlib.http.authentication.BasicProxyAuth.AUTH_HEADER,
+ mitmproxy.net.http.authentication.BasicProxyAuth.AUTH_HEADER,
authentication.assemble_http_basic_auth("basic", "test", "test")
))
assert ret.status_code == 202
@@ -314,7 +314,7 @@ class TestHTTPReverseAuth(tservers.ReverseProxyTest):
'/p/202'
h'%s'='%s'
""" % (
- netlib.http.authentication.BasicWebsiteAuth.AUTH_HEADER,
+ mitmproxy.net.http.authentication.BasicWebsiteAuth.AUTH_HEADER,
authentication.assemble_http_basic_auth("basic", "test", "test")
))
assert ret.status_code == 202
@@ -438,7 +438,7 @@ class TestHTTPSUpstreamServerVerificationWBadCert(tservers.HTTPProxyTest):
def test_verification_w_bad_cert(self):
# We only test for a single invalid cert here.
# Actual testing of different root-causes (invalid hostname, expired, ...)
- # is done in netlib.
+ # is done in mitmproxy.net.
self.config.options.ssl_insecure = False
r = self._request()
assert r.status_code == 502
diff --git a/test/pathod/test_language_http2.py b/test/pathod/test_language_http2.py
index 11e100ac..7d3a8e60 100644
--- a/test/pathod/test_language_http2.py
+++ b/test/pathod/test_language_http2.py
@@ -1,7 +1,7 @@
import io
-from netlib import tcp
-from netlib.http import user_agents
+from mitmproxy.net import tcp
+from mitmproxy.net.http import user_agents
from pathod import language
from pathod.language import http2
diff --git a/test/pathod/test_language_websocket.py b/test/pathod/test_language_websocket.py
index 9d533d98..49fbd4e6 100644
--- a/test/pathod/test_language_websocket.py
+++ b/test/pathod/test_language_websocket.py
@@ -1,6 +1,6 @@
from pathod import language
from pathod.language import websockets
-import netlib.websockets
+import mitmproxy.net.websockets
from . import tutils
@@ -62,7 +62,7 @@ class TestWebsocketFrame:
def test_flags(self):
wf = parse_request("wf:fin:mask:rsv1:rsv2:rsv3")
- frm = netlib.websockets.Frame.from_bytes(tutils.render(wf))
+ frm = mitmproxy.net.websockets.Frame.from_bytes(tutils.render(wf))
assert frm.header.fin
assert frm.header.mask
assert frm.header.rsv1
@@ -70,7 +70,7 @@ class TestWebsocketFrame:
assert frm.header.rsv3
wf = parse_request("wf:-fin:-mask:-rsv1:-rsv2:-rsv3")
- frm = netlib.websockets.Frame.from_bytes(tutils.render(wf))
+ frm = mitmproxy.net.websockets.Frame.from_bytes(tutils.render(wf))
assert not frm.header.fin
assert not frm.header.mask
assert not frm.header.rsv1
@@ -80,15 +80,15 @@ class TestWebsocketFrame:
def fr(self, spec, **kwargs):
settings = language.base.Settings(**kwargs)
wf = parse_request(spec)
- return netlib.websockets.Frame.from_bytes(tutils.render(wf, settings))
+ return mitmproxy.net.websockets.Frame.from_bytes(tutils.render(wf, settings))
def test_construction(self):
assert self.fr("wf:c1").header.opcode == 1
assert self.fr("wf:c0").header.opcode == 0
assert self.fr("wf:cbinary").header.opcode ==\
- netlib.websockets.OPCODE.BINARY
+ mitmproxy.net.websockets.OPCODE.BINARY
assert self.fr("wf:ctext").header.opcode ==\
- netlib.websockets.OPCODE.TEXT
+ mitmproxy.net.websockets.OPCODE.TEXT
def test_rawbody(self):
frm = self.fr("wf:mask:r'foo'")
diff --git a/test/pathod/test_pathoc.py b/test/pathod/test_pathoc.py
index 98dc9825..90177ff6 100644
--- a/test/pathod/test_pathoc.py
+++ b/test/pathod/test_pathoc.py
@@ -1,9 +1,9 @@
import io
from mock import Mock
-from netlib import http
-from netlib import tcp
-from netlib.http import http1
+from mitmproxy.net import http
+from mitmproxy.net import tcp
+from mitmproxy.net.http import http1
from mitmproxy.test.tutils import raises
from mitmproxy import exceptions
diff --git a/test/pathod/test_pathod.py b/test/pathod/test_pathod.py
index 402cd638..8ee7a2fd 100644
--- a/test/pathod/test_pathod.py
+++ b/test/pathod/test_pathod.py
@@ -1,7 +1,7 @@
import io
from pathod import pathod
-from netlib import tcp
+from mitmproxy.net import tcp
from mitmproxy import exceptions
from . import tutils
diff --git a/test/pathod/test_protocols_http2.py b/test/pathod/test_protocols_http2.py
index a7303115..d77702a3 100644
--- a/test/pathod/test_protocols_http2.py
+++ b/test/pathod/test_protocols_http2.py
@@ -2,12 +2,12 @@ import mock
import codecs
import hyperframe
-from netlib import tcp, http
+from mitmproxy.net import tcp, http
from mitmproxy.test.tutils import raises
-from netlib.http import http2
+from mitmproxy.net.http import http2
from mitmproxy import exceptions
-from ..netlib import tservers as netlib_tservers
+from ..mitmproxy.net import tservers as net_tservers
from pathod.protocols.http2 import HTTP2StateProtocol, TCPHandler
@@ -66,7 +66,7 @@ class TestProtocol:
assert mock_server_method.called
-class TestCheckALPNMatch(netlib_tservers.ServerTestBase):
+class TestCheckALPNMatch(net_tservers.ServerTestBase):
handler = EchoHandler
ssl = dict(
alpn_select=b'h2',
@@ -82,7 +82,7 @@ class TestCheckALPNMatch(netlib_tservers.ServerTestBase):
assert protocol.check_alpn()
-class TestCheckALPNMismatch(netlib_tservers.ServerTestBase):
+class TestCheckALPNMismatch(net_tservers.ServerTestBase):
handler = EchoHandler
ssl = dict(
alpn_select=None,
@@ -99,7 +99,7 @@ class TestCheckALPNMismatch(netlib_tservers.ServerTestBase):
protocol.check_alpn()
-class TestPerformServerConnectionPreface(netlib_tservers.ServerTestBase):
+class TestPerformServerConnectionPreface(net_tservers.ServerTestBase):
class handler(tcp.BaseHandler):
def handle(self):
@@ -136,7 +136,7 @@ class TestPerformServerConnectionPreface(netlib_tservers.ServerTestBase):
protocol.perform_server_connection_preface(force=True)
-class TestPerformClientConnectionPreface(netlib_tservers.ServerTestBase):
+class TestPerformClientConnectionPreface(net_tservers.ServerTestBase):
class handler(tcp.BaseHandler):
def handle(self):
@@ -197,7 +197,7 @@ class TestserverstreamIds:
assert self.protocol.current_stream_id == 6
-class TestApplySettings(netlib_tservers.ServerTestBase):
+class TestApplySettings(net_tservers.ServerTestBase):
class handler(tcp.BaseHandler):
def handle(self):
# check settings acknowledgement
@@ -290,7 +290,7 @@ class TestCreateBody:
assert bytes[2] == codecs.decode('0000020001000000013432', 'hex_codec')
-class TestReadRequest(netlib_tservers.ServerTestBase):
+class TestReadRequest(net_tservers.ServerTestBase):
class handler(tcp.BaseHandler):
def handle(self):
@@ -320,7 +320,7 @@ class TestReadRequest(netlib_tservers.ServerTestBase):
assert req.content == b'foobar'
-class TestReadRequestRelative(netlib_tservers.ServerTestBase):
+class TestReadRequestRelative(net_tservers.ServerTestBase):
class handler(tcp.BaseHandler):
def handle(self):
self.wfile.write(
@@ -343,7 +343,7 @@ class TestReadRequestRelative(netlib_tservers.ServerTestBase):
assert req.path == "*"
-class TestReadRequestAbsolute(netlib_tservers.ServerTestBase):
+class TestReadRequestAbsolute(net_tservers.ServerTestBase):
class handler(tcp.BaseHandler):
def handle(self):
self.wfile.write(
@@ -367,7 +367,7 @@ class TestReadRequestAbsolute(netlib_tservers.ServerTestBase):
assert req.port == 22
-class TestReadResponse(netlib_tservers.ServerTestBase):
+class TestReadResponse(net_tservers.ServerTestBase):
class handler(tcp.BaseHandler):
def handle(self):
self.wfile.write(
@@ -396,7 +396,7 @@ class TestReadResponse(netlib_tservers.ServerTestBase):
assert resp.timestamp_end
-class TestReadEmptyResponse(netlib_tservers.ServerTestBase):
+class TestReadEmptyResponse(net_tservers.ServerTestBase):
class handler(tcp.BaseHandler):
def handle(self):
self.wfile.write(
diff --git a/test/pathod/tutils.py b/test/pathod/tutils.py
index 16dec187..ccc3df43 100644
--- a/test/pathod/tutils.py
+++ b/test/pathod/tutils.py
@@ -7,7 +7,7 @@ import urllib
from mitmproxy.utils import data
-from netlib import tcp
+from mitmproxy.net import tcp
from mitmproxy.test import tutils
from pathod import language