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,14 +1,13 @@
from __future__ import annotations
import pickle
import json
import tomllib
from pathlib import Path
from typing import TYPE_CHECKING, Any, cast
from typing import Any, cast
import pandas as pd
import pytest
if TYPE_CHECKING:
from delta_barth.api.requests import SalesPrognosisResponse
@ -68,10 +67,10 @@ def sales_data() -> pd.DataFrame:
def exmpl_api_sales_prognosis_resp() -> SalesPrognosisResponse:
pwd = Path.cwd()
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"
with open(data_pth, "rb") as file:
data = cast("SalesPrognosisResponse", pickle.load(file))
with open(data_pth, "r") as file:
data = json.load(file)
return data
return SalesPrognosisResponse(**data)