tests: use relative imports
This commit is contained in:
parent
bceeb4a291
commit
aaf82cae7d
|
@ -1,3 +1,4 @@
|
|||
from __future__ import (print_function, absolute_import, division)
|
||||
|
||||
# Silence third-party modules
|
||||
import logging
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import tutils
|
||||
import tservers
|
||||
from . import tutils, tservers
|
||||
|
||||
|
||||
class TestApp(tservers.HTTPProxTest):
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import argparse
|
||||
from libmproxy import cmdline
|
||||
import tutils
|
||||
from . import tutils
|
||||
|
||||
|
||||
def test_parse_replace_hook():
|
||||
|
|
|
@ -4,7 +4,7 @@ import netlib.tutils
|
|||
from libmproxy import console
|
||||
from libmproxy.console import common
|
||||
|
||||
import tutils
|
||||
from . import tutils
|
||||
|
||||
|
||||
class TestConsoleState:
|
||||
|
|
|
@ -5,7 +5,7 @@ if os.name == "nt":
|
|||
|
||||
|
||||
import libmproxy.console.common as common
|
||||
import tutils
|
||||
from . import tutils
|
||||
|
||||
|
||||
def test_format_flow():
|
||||
|
|
|
@ -2,7 +2,7 @@ import os
|
|||
from os.path import normpath
|
||||
from libmproxy.console import pathedit
|
||||
|
||||
import tutils
|
||||
from . import tutils
|
||||
|
||||
|
||||
class TestPathCompleter:
|
||||
|
|
|
@ -4,7 +4,7 @@ import netlib.utils
|
|||
from netlib import encoding
|
||||
|
||||
import libmproxy.contentviews as cv
|
||||
import tutils
|
||||
from . import tutils
|
||||
|
||||
try:
|
||||
import pyamf
|
||||
|
|
|
@ -8,7 +8,7 @@ from netlib.http import CONTENT_MISSING
|
|||
|
||||
from libmproxy import dump, flow
|
||||
from libmproxy.proxy import Log
|
||||
import tutils
|
||||
from . import tutils
|
||||
import mock
|
||||
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import glob
|
||||
from libmproxy import utils, script
|
||||
from libmproxy.proxy import config
|
||||
import tservers
|
||||
from . import tservers
|
||||
|
||||
|
||||
def test_load_scripts():
|
||||
|
|
|
@ -3,7 +3,7 @@ from libmproxy import filt
|
|||
from libmproxy.protocol import http
|
||||
from libmproxy.models import Error
|
||||
from netlib.http import Headers
|
||||
import tutils
|
||||
from . import tutils
|
||||
|
||||
|
||||
class TestParsing:
|
||||
|
|
|
@ -19,7 +19,7 @@ from libmproxy.proxy.config import HostMatcher
|
|||
from libmproxy.proxy import ProxyConfig
|
||||
from libmproxy.proxy.server import DummyServer
|
||||
from libmproxy.models.connections import ClientConnection
|
||||
import tutils
|
||||
from . import tutils
|
||||
|
||||
|
||||
def test_app_registry():
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
from libmproxy.flow import FlowReader, FlowReadError
|
||||
import tutils
|
||||
from . import tutils
|
||||
|
||||
|
||||
def test_load():
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import tservers
|
||||
from . import tservers
|
||||
|
||||
"""
|
||||
A collection of errors turned up by fuzzing. Errors are integrated here
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import tutils
|
||||
import sys
|
||||
from libmproxy.platform import pf
|
||||
from . import tutils
|
||||
|
||||
|
||||
class TestLookup:
|
||||
|
|
|
@ -3,8 +3,7 @@ from netlib.exceptions import HttpSyntaxException
|
|||
from netlib.http import http1
|
||||
from netlib.tcp import TCPClient
|
||||
from netlib.tutils import treq, raises
|
||||
import tutils
|
||||
import tservers
|
||||
from . import tutils, tservers
|
||||
|
||||
|
||||
class TestHTTPResponse:
|
||||
|
|
|
@ -8,9 +8,9 @@ from libmproxy.proxy.config import process_proxy_options
|
|||
from libmproxy.models.connections import ServerConnection
|
||||
from libmproxy.proxy.server import DummyServer, ProxyServer, ConnectionHandler
|
||||
from netlib.exceptions import TcpDisconnect
|
||||
import tutils
|
||||
from libpathod import test
|
||||
from netlib.http import http1
|
||||
from . import tutils
|
||||
|
||||
|
||||
class TestServerConnection(object):
|
||||
|
|
|
@ -2,7 +2,7 @@ import os
|
|||
import time
|
||||
import mock
|
||||
from libmproxy import script, flow
|
||||
import tutils
|
||||
from . import tutils
|
||||
|
||||
|
||||
def test_simple():
|
||||
|
|
|
@ -16,8 +16,7 @@ from libmproxy.proxy.config import HostMatcher
|
|||
from libmproxy.protocol import Kill
|
||||
from libmproxy.models import Error, HTTPResponse
|
||||
|
||||
import tutils
|
||||
import tservers
|
||||
from . import tutils, tservers
|
||||
|
||||
"""
|
||||
Note that the choice of response code in these tests matters more than you
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import json
|
||||
from libmproxy import utils
|
||||
import tutils
|
||||
from . import tutils
|
||||
|
||||
utils.CERT_SLEEP_TIME = 0
|
||||
|
||||
|
|
Loading…
Reference in New Issue