Skip to content
Snippets Groups Projects
Commit b89fbb57896e authored by Arnaud Vergnet's avatar Arnaud Vergnet :sun_with_face:
Browse files

test: move base_url init in base class

parent 431056164960
No related branches found
No related tags found
1 merge request!62tests: improve coverage
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
import json import json
import webtest import webtest
from test.util import ApiBaseTC, BASE_URL from test.util import ApiBaseTC
from cubicweb import Binary from cubicweb import Binary
...@@ -28,11 +28,6 @@ ...@@ -28,11 +28,6 @@
def get_body(self, queries: list): def get_body(self, queries: list):
return json.dumps(queries) return json.dumps(queries)
@classmethod
def init_config(cls, config):
super().init_config(config)
config.global_set_option("base-url", BASE_URL)
def make_rql_request(self, queries: list[object], status: int = 200): def make_rql_request(self, queries: list[object], status: int = 200):
return self.webapp.post( return self.webapp.post(
self.get_api_path("rql"), self.get_api_path("rql"),
......
...@@ -17,6 +17,11 @@ ...@@ -17,6 +17,11 @@
custom_headers = {"X-Client-Name": "Pytest"} custom_headers = {"X-Client-Name": "Pytest"}
@classmethod @classmethod
def init_config(cls, config):
super().init_config(config)
config.global_set_option("base-url", BASE_URL)
@classmethod
def get_api_path(cls, endpoint: str): def get_api_path(cls, endpoint: str):
return f"{BASE_URL[:-1]}{API_PATH_DEFAULT_PREFIX}/v1/{endpoint}" return f"{BASE_URL[:-1]}{API_PATH_DEFAULT_PREFIX}/v1/{endpoint}"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment