mirror of
https://github.com/zhigang1992/mitmproxy.git
synced 2026-04-24 04:14:57 +08:00
py3++: mitmproxy.protocol.http1
This commit is contained in:
@@ -18,14 +18,14 @@ class TestInvalidRequests(tservers.HTTPProxyTest):
|
||||
p = self.pathoc()
|
||||
r = p.request("connect:'%s:%s'" % ("127.0.0.1", self.server2.port))
|
||||
assert r.status_code == 400
|
||||
assert "Invalid HTTP request form" in r.content
|
||||
assert b"Invalid HTTP request form" in r.content
|
||||
|
||||
def test_relative_request(self):
|
||||
p = self.pathoc_raw()
|
||||
p.connect()
|
||||
r = p.request("get:/p/200")
|
||||
assert r.status_code == 400
|
||||
assert "Invalid HTTP request form" in r.content
|
||||
assert b"Invalid HTTP request form" in r.content
|
||||
|
||||
|
||||
class TestExpectHeader(tservers.HTTPProxyTest):
|
||||
@@ -43,8 +43,8 @@ class TestExpectHeader(tservers.HTTPProxyTest):
|
||||
)
|
||||
client.wfile.flush()
|
||||
|
||||
assert client.rfile.readline() == "HTTP/1.1 100 Continue\r\n"
|
||||
assert client.rfile.readline() == "\r\n"
|
||||
assert client.rfile.readline() == b"HTTP/1.1 100 Continue\r\n"
|
||||
assert client.rfile.readline() == b"\r\n"
|
||||
|
||||
client.wfile.write(b"0123456789abcdef\r\n")
|
||||
client.wfile.flush()
|
||||
|
||||
2
tox.ini
2
tox.ini
@@ -7,7 +7,7 @@ deps =
|
||||
codecov>=2.0.5
|
||||
passenv = CI TRAVIS_BUILD_ID TRAVIS TRAVIS_BRANCH TRAVIS_JOB_NUMBER TRAVIS_PULL_REQUEST TRAVIS_JOB_ID TRAVIS_REPO_SLUG TRAVIS_COMMIT
|
||||
setenv =
|
||||
PY3TESTS = test/netlib test/pathod/ test/mitmproxy/script test/mitmproxy/test_contentview.py test/mitmproxy/test_custom_contentview.py test/mitmproxy/test_app.py test/mitmproxy/test_controller.py test/mitmproxy/test_fuzzing.py test/mitmproxy/test_script.py test/mitmproxy/test_web_app.py test/mitmproxy/test_utils.py test/mitmproxy/test_stateobject.py test/mitmproxy/test_cmdline.py test/mitmproxy/test_contrib_tnetstring.py test/mitmproxy/test_proxy.py
|
||||
PY3TESTS = test/netlib test/pathod/ test/mitmproxy/script test/mitmproxy/test_contentview.py test/mitmproxy/test_custom_contentview.py test/mitmproxy/test_app.py test/mitmproxy/test_controller.py test/mitmproxy/test_fuzzing.py test/mitmproxy/test_script.py test/mitmproxy/test_web_app.py test/mitmproxy/test_utils.py test/mitmproxy/test_stateobject.py test/mitmproxy/test_cmdline.py test/mitmproxy/test_contrib_tnetstring.py test/mitmproxy/test_proxy.py test/mitmproxy/test_protocol_http1.py
|
||||
|
||||
[testenv:py27]
|
||||
commands =
|
||||
|
||||
Reference in New Issue
Block a user