import pytest

from delta_barth.api import common
from delta_barth.constants import HTTP_BASE_CONTENT_HEADERS


@pytest.fixture(scope="function")
def session(credentials, api_base_url) -> common.Session:
    session = common.Session(HTTP_BASE_CONTENT_HEADERS)
    session.set_base_url(api_base_url)
    session.set_credentials(
        user_name=credentials["user"],
        password=credentials["pwd"],
        database=credentials["db"],
        mandant=credentials["mandant"],
    )

    return session
