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 return task_code
def url(flow):
return flow.request.url
EXPORTERS = [ EXPORTERS = [
("content", "c"), ("content", "c"),
("headers+content", "h"), ("headers+content", "h"),

View File

@ -117,3 +117,9 @@ class TestIsJson():
headers = Headers(content_type="application/json") headers = Headers(content_type="application/json")
j = export.is_json(headers, b'{"name": "example", "email": "example@example.com"}') j = export.is_json(headers, b'{"name": "example", "email": "example@example.com"}')
assert isinstance(j, dict) assert isinstance(j, dict)
class TestURL():
def test_url(self):
flow = tutils.tflow()
assert export.url(flow) == "http://address:22/path"