fix testing data
This commit is contained in:
parent
42ac7c17db
commit
8d6a25aaf7
10560
tests/_test_data/exmp_sales_prognosis_resp.json
Normal file
10560
tests/_test_data/exmp_sales_prognosis_resp.json
Normal file
File diff suppressed because it is too large
Load Diff
Binary file not shown.
@ -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)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user