Merge "metrics_database": first database integration for metrics logging #9
@ -11,10 +11,11 @@ from delta_barth.session import Session
|
|||||||
SESSION: Final[Session] = Session(HTTP_BASE_CONTENT_HEADERS)
|
SESSION: Final[Session] = Session(HTTP_BASE_CONTENT_HEADERS)
|
||||||
|
|
||||||
|
|
||||||
def set_data_path(
|
def setup(
|
||||||
path: str,
|
data_path: str,
|
||||||
) -> None: # pragma: no cover
|
) -> None: # pragma: no cover
|
||||||
SESSION.set_data_path(path)
|
SESSION.set_data_path(data_path)
|
||||||
|
SESSION.setup()
|
||||||
|
|
||||||
|
|
||||||
def set_credentials(
|
def set_credentials(
|
||||||
|
|||||||
@ -74,8 +74,9 @@ def exmpl_api_sales_prognosis_output() -> pd.DataFrame:
|
|||||||
|
|
||||||
# ** sessions
|
# ** sessions
|
||||||
@pytest.fixture(scope="function")
|
@pytest.fixture(scope="function")
|
||||||
def session(credentials, api_base_url) -> delta_barth.session.Session:
|
def session(credentials, api_base_url, tmp_path) -> delta_barth.session.Session:
|
||||||
session = delta_barth.session.Session(HTTP_BASE_CONTENT_HEADERS)
|
session = delta_barth.session.Session(HTTP_BASE_CONTENT_HEADERS)
|
||||||
|
session.set_data_path(str(tmp_path))
|
||||||
session.set_base_url(api_base_url)
|
session.set_base_url(api_base_url)
|
||||||
session.set_credentials(
|
session.set_credentials(
|
||||||
username=credentials["user"],
|
username=credentials["user"],
|
||||||
@ -83,6 +84,7 @@ def session(credentials, api_base_url) -> delta_barth.session.Session:
|
|||||||
database=credentials["db"],
|
database=credentials["db"],
|
||||||
mandant=credentials["mandant"],
|
mandant=credentials["mandant"],
|
||||||
)
|
)
|
||||||
|
session.setup()
|
||||||
|
|
||||||
return session
|
return session
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user