Add a url exporter

This commit is contained in:
Shadab Zafar 2016-07-17 09:54:41 +05:30
parent 0d478e71ee
commit c84d0bd10b
2 changed files with 10 additions and 0 deletions

View File

@ -194,6 +194,10 @@ def locust_task(flow):
return task_code
def url(flow):
return flow.request.url
EXPORTERS = [
("content", "c"),
("headers+content", "h"),

View File

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