fix testing data

This commit is contained in:
Florian Förster 2025-03-07 13:12:16 +01:00
parent 42ac7c17db
commit 8d6a25aaf7
3 changed files with 10567 additions and 8 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,15 +1,14 @@
from __future__ import annotations from __future__ import annotations
import pickle import json
import tomllib import tomllib
from pathlib import Path from pathlib import Path
from typing import TYPE_CHECKING, Any, cast from typing import Any, cast
import pandas as pd import pandas as pd
import pytest import pytest
if TYPE_CHECKING: from delta_barth.api.requests import SalesPrognosisResponse
from delta_barth.api.requests import SalesPrognosisResponse
@pytest.fixture(scope="session") @pytest.fixture(scope="session")
@ -68,10 +67,10 @@ def sales_data() -> pd.DataFrame:
def exmpl_api_sales_prognosis_resp() -> SalesPrognosisResponse: def exmpl_api_sales_prognosis_resp() -> SalesPrognosisResponse:
pwd = Path.cwd() pwd = Path.cwd()
assert "barth" in pwd.parent.name.lower(), "not in project root directory" assert "barth" in pwd.parent.name.lower(), "not in project root directory"
data_pth = pwd / "./tests/_test_data/exmp_sales_prognosis_resp.pkl" data_pth = pwd / "./tests/_test_data/exmp_sales_prognosis_resp.json"
assert data_pth.exists(), "file to API sales data not found" assert data_pth.exists(), "file to API sales data not found"
with open(data_pth, "rb") as file: with open(data_pth, "r") as file:
data = cast("SalesPrognosisResponse", pickle.load(file)) data = json.load(file)
return data return SalesPrognosisResponse(**data)