py3++: test_dump

This commit is contained in:
Shadab Zafar 2016-06-28 20:54:02 +05:30
parent 15c10d49f6
commit b4469d2579
3 changed files with 6 additions and 5 deletions

View File

@ -248,7 +248,7 @@ class DumpMaster(flow.FlowMaster):
else:
client = click.style("[replay]", fg="yellow", bold=True)
method = flow.request.method
method = flow.request.data.method
method_color = dict(
GET="green",
DELETE="red"
@ -258,7 +258,7 @@ class DumpMaster(flow.FlowMaster):
url = flow.request.pretty_url
else:
url = flow.request.url
url = click.style(strutils.bytes_to_escaped_str(url), bold=True)
url = click.style(url, bold=True)
httpversion = ""
if flow.request.http_version not in ("HTTP/1.1", "HTTP/1.0"):
@ -288,7 +288,7 @@ class DumpMaster(flow.FlowMaster):
elif 400 <= code < 600:
code_color = "red"
code = click.style(str(code), fg=code_color, bold=True, blink=(code == 418))
reason = click.style(strutils.bytes_to_escaped_str(flow.response.reason), fg=code_color, bold=True)
reason = click.style(strutils.bytes_to_escaped_str(flow.response.data.reason), fg=code_color, bold=True)
if flow.response.content is None:
size = "(content missing)"

View File

@ -1,6 +1,7 @@
from __future__ import absolute_import, print_function, division
import cgi
import six
from mitmproxy.models.flow import Flow
from netlib import encoding
@ -220,7 +221,7 @@ class HTTPFlow(Flow):
If f is a string, it will be compiled as a filter expression. If
the expression is invalid, ValueError is raised.
"""
if isinstance(f, str):
if isinstance(f, six.string_types):
from .. import filt
f = filt.parse(f)

View File

@ -16,7 +16,7 @@ commands =
[testenv:py35]
setenv =
TESTS = --ignore=test/mitmproxy/test_dump.py test/
TESTS = test/
HOME = {envtmpdir}
[testenv:docs]