aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMaximilian Hils <git@maximilianhils.com>2019-10-30 16:09:29 +0100
committerGitHub <noreply@github.com>2019-10-30 16:09:29 +0100
commit65edbda137b5c5946314d38cb78b035deed8ac05 (patch)
tree305036f212ac810a78a45294966128f858921e57 /test
parenteb7ed1dc40025dd9eada5b01852fc20106a4a204 (diff)
parentfcccab684d61d9c428fd9b862db14dd9da5a0e38 (diff)
downloadmitmproxy-65edbda137b5c5946314d38cb78b035deed8ac05.tar.gz
mitmproxy-65edbda137b5c5946314d38cb78b035deed8ac05.tar.bz2
mitmproxy-65edbda137b5c5946314d38cb78b035deed8ac05.zip
Merge pull request #3676 from ylmrx/fix_curl_export
curl command export has several problems:
Diffstat (limited to 'test')
-rw-r--r--test/mitmproxy/addons/test_export.py24
1 files changed, 9 insertions, 15 deletions
diff --git a/test/mitmproxy/addons/test_export.py b/test/mitmproxy/addons/test_export.py
index f4bb0f64..c86e0c7d 100644
--- a/test/mitmproxy/addons/test_export.py
+++ b/test/mitmproxy/addons/test_export.py
@@ -14,29 +14,23 @@ from unittest import mock
@pytest.fixture
def get_request():
return tflow.tflow(
- req=tutils.treq(
- method=b'GET',
- content=b'',
- path=b"/path?a=foo&a=bar&b=baz"
- )
- )
+ req=tutils.treq(method=b'GET', content=b'', path=b"/path?a=foo&a=bar&b=baz"))
@pytest.fixture
def post_request():
return tflow.tflow(
- req=tutils.treq(
- method=b'POST',
- headers=(),
- content=bytes(range(256))
- )
- )
+ req=tutils.treq(method=b'POST', headers=(), content=bytes(range(256))))
@pytest.fixture
def patch_request():
return tflow.tflow(
- req=tutils.treq(method=b'PATCH', path=b"/path?query=param")
+ req=tutils.treq(
+ method=b'PATCH',
+ content=b'content',
+ path=b"/path?query=param"
+ )
)
@@ -47,7 +41,7 @@ def tcp_flow():
class TestExportCurlCommand:
def test_get(self, get_request):
- result = """curl -H 'header:qvalue' -H 'content-length:0' 'http://address:22/path?a=foo&a=bar&b=baz'"""
+ result = """curl -H 'header:qvalue' 'http://address:22/path?a=foo&a=bar&b=baz'"""
assert export.curl_command(get_request) == result
def test_post(self, post_request):
@@ -67,7 +61,7 @@ class TestExportCurlCommand:
class TestExportHttpieCommand:
def test_get(self, get_request):
- result = """http GET http://address:22/path?a=foo&a=bar&b=baz 'header:qvalue' 'content-length:0'"""
+ result = """http GET http://address:22/path?a=foo&a=bar&b=baz 'header:qvalue'"""
assert export.httpie_command(get_request) == result
def test_post(self, post_request):