From 8f4d49e22aa401760c87d00ba9355e6abc6b3251 Mon Sep 17 00:00:00 2001 From: Shadab Zafar Date: Sat, 16 Jul 2016 17:43:42 +0530 Subject: Remove raw_request exporter This functionality will be handled by headers+content --- test/mitmproxy/test_flow_export.py | 36 ------------------------------------ 1 file changed, 36 deletions(-) (limited to 'test') diff --git a/test/mitmproxy/test_flow_export.py b/test/mitmproxy/test_flow_export.py index e6d65e40..41089a64 100644 --- a/test/mitmproxy/test_flow_export.py +++ b/test/mitmproxy/test_flow_export.py @@ -1,4 +1,3 @@ -from textwrap import dedent import re import netlib.tutils @@ -70,41 +69,6 @@ class TestExportPythonCode(): python_equals("data/test_flow_export/python_patch.py", export.python_code(flow)) -class TestRawRequest(): - def test_get(self): - flow = tutils.tflow(req=req_get()) - result = dedent(""" - GET /path?a=foo&a=bar&b=baz HTTP/1.1\r - header: qvalue\r - content-length: 7\r - host: address:22\r - \r - """).strip(" ").lstrip() - assert export.raw_request(flow) == result - - def test_post(self): - flow = tutils.tflow(req=req_post()) - result = dedent(""" - POST /path HTTP/1.1\r - host: address:22\r - \r - content - """).strip() - assert export.raw_request(flow) == result - - def test_patch(self): - flow = tutils.tflow(req=req_patch()) - result = dedent(""" - PATCH /path?query=param HTTP/1.1\r - header: qvalue\r - content-length: 7\r - host: address:22\r - \r - content - """).strip() - assert export.raw_request(flow) == result - - class TestExportLocustCode(): def test_get(self): flow = tutils.tflow(req=req_get()) -- cgit v1.2.3 From c84d0bd10bdaa5c70b519d16d3329be2a3b7ae8a Mon Sep 17 00:00:00 2001 From: Shadab Zafar Date: Sun, 17 Jul 2016 09:54:41 +0530 Subject: Add a url exporter --- test/mitmproxy/test_flow_export.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test') diff --git a/test/mitmproxy/test_flow_export.py b/test/mitmproxy/test_flow_export.py index 41089a64..86ff937d 100644 --- a/test/mitmproxy/test_flow_export.py +++ b/test/mitmproxy/test_flow_export.py @@ -117,3 +117,9 @@ class TestIsJson(): headers = Headers(content_type="application/json") j = export.is_json(headers, b'{"name": "example", "email": "example@example.com"}') assert isinstance(j, dict) + + +class TestURL(): + def test_url(self): + flow = tutils.tflow() + assert export.url(flow) == "http://address:22/path" -- cgit v1.2.3