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,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)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user