tests: use relative imports

This commit is contained in:
Maximilian Hils 2016-02-02 13:25:31 +01:00
parent bceeb4a291
commit aaf82cae7d
19 changed files with 19 additions and 21 deletions

View File

@ -1,3 +1,4 @@
from __future__ import (print_function, absolute_import, division)
# Silence third-party modules
import logging

View File

@ -1,5 +1,4 @@
import tutils
import tservers
from . import tutils, tservers
class TestApp(tservers.HTTPProxTest):

View File

@ -1,6 +1,6 @@
import argparse
from libmproxy import cmdline
import tutils
from . import tutils
def test_parse_replace_hook():

View File

@ -4,7 +4,7 @@ import netlib.tutils
from libmproxy import console
from libmproxy.console import common
import tutils
from . import tutils
class TestConsoleState:

View File

@ -5,7 +5,7 @@ if os.name == "nt":
import libmproxy.console.common as common
import tutils
from . import tutils
def test_format_flow():

View File

@ -2,7 +2,7 @@ import os
from os.path import normpath
from libmproxy.console import pathedit
import tutils
from . import tutils
class TestPathCompleter:

View File

@ -4,7 +4,7 @@ import netlib.utils
from netlib import encoding
import libmproxy.contentviews as cv
import tutils
from . import tutils
try:
import pyamf

View File

@ -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

View File

@ -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():

View File

@ -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:

View File

@ -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():

View File

@ -1,5 +1,5 @@
from libmproxy.flow import FlowReader, FlowReadError
import tutils
from . import tutils
def test_load():

View File

@ -1,4 +1,4 @@
import tservers
from . import tservers
"""
A collection of errors turned up by fuzzing. Errors are integrated here

View File

@ -1,6 +1,6 @@
import tutils
import sys
from libmproxy.platform import pf
from . import tutils
class TestLookup:

View File

@ -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:

View File

@ -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):

View File

@ -2,7 +2,7 @@ import os
import time
import mock
from libmproxy import script, flow
import tutils
from . import tutils
def test_simple():

View File

@ -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

View File

@ -1,6 +1,6 @@
import json
from libmproxy import utils
import tutils
from . import tutils
utils.CERT_SLEEP_TIME = 0