diff --git a/marconi/tests/functional/http.py b/marconi/tests/functional/http.py index e9368678e..a779c293c 100755 --- a/marconi/tests/functional/http.py +++ b/marconi/tests/functional/http.py @@ -19,6 +19,22 @@ import json import requests +def _build_url(method): + + @functools.wraps(method) + def wrapper(self, url='', **kwargs): + + if not url.startswith("http"): + if not self.base_url: + raise RuntimeError("Base url not set") + + url = self.base_url + url or '' + + return method(self, url, **kwargs) + + return wrapper + + class Client(object): def __init__(self): @@ -31,19 +47,6 @@ class Client(object): def set_headers(self, headers): self.session.headers.update(headers) - def _build_url(method): - - @functools.wraps(method) - def wrapper(self, url='', **kwargs): - - if not url.startswith("http"): - if not self.base_url: - raise RuntimeError("Base url not set") - url = self.base_url + url or '' - - return method(self, url, **kwargs) - return wrapper - @_build_url def get(self, url=None, **kwargs): """Does http GET."""