Remove /controller from the api endpoint

This commit is contained in:
Julien Duponchelle committed 2016-03-11 17:16:09 +01:00
1 parent e3580d52c3
commit 8c1560332e
107 files changed
+356 -310

No files matched your search

+1 -1
View File
@@ -119,7 +119,7 @@ def http_controller(loop, http_server):
Return an helper allowing you to call the server API without any prefix
"""
host, port = http_server
return Query(loop, host=host, port=port, prefix="/controller", api_version=2)
return Query(loop, host=host, port=port, api_version=2)
@pytest.fixture
+2 -2
View File
@@ -113,12 +113,12 @@ class Query:
if path is None:
return
with open(self._example_file_path(method, route), 'w+') as f:
f.write("curl -i -X {} 'http://localhost:8000/v{}{}'".format(method, self._api_version, path))
f.write("curl -i -X {} 'http://localhost:8000/v{}{}{}'".format(method, self._api_version, self._prefix, path))
if body:
f.write(" -d '{}'".format(re.sub(r"\n", "", json.dumps(json.loads(body), sort_keys=True))))
f.write("\n\n")
f.write("{} /v{}{} HTTP/1.1\n".format(method, self._api_version, path))
f.write("{} /v{}{}{} HTTP/1.1\n".format(method, self._api_version, self._prefix, path))
if body:
f.write(json.dumps(json.loads(body), sort_keys=True, indent=4))
f.write("\n\n\n")