mirror of
https://github.com/fhswf/aki_prj23_transparenzregister.git
synced 2025-06-21 23:23:55 +02:00
update data based on selected company (#122)
Added UI elements to select a company and update shown data depending on chosen company --------- Co-authored-by: Philipp Horstenkamp <philipp@horstenkamp.de>
This commit is contained in:
@ -168,7 +168,7 @@ def test_get_person_id_value_check(
|
||||
data_transfer.get_person_id(
|
||||
firstname,
|
||||
surname,
|
||||
date.fromisoformat(date_str) if date_str else None, # type: ignore
|
||||
date.fromisoformat(date_str) if date_str else None,
|
||||
full_db,
|
||||
)
|
||||
|
||||
@ -941,7 +941,11 @@ def test_add_annual_report_to_unknown_company(
|
||||
@pytest.mark.parametrize("year", [2023, 2025, 2020])
|
||||
@pytest.mark.parametrize("short_term_debt", [2023.2, 2025.5, 2020.5, float("NaN")])
|
||||
def test_add_annual_report(
|
||||
short_term_debt: float, company_id: int, year: int, full_db: Session
|
||||
short_term_debt: float,
|
||||
company_id: int,
|
||||
year: int,
|
||||
finance_statements: list[dict[str, Any]],
|
||||
full_db: Session,
|
||||
) -> None:
|
||||
"""Tests the addition of annual financial records."""
|
||||
data_transfer.add_annual_report(
|
||||
@ -961,34 +965,38 @@ def test_add_annual_report(
|
||||
df_prior = pd.read_sql_table(
|
||||
entities.AnnualFinanceStatement.__tablename__, full_db.bind # type: ignore
|
||||
)
|
||||
expected_results = pd.DataFrame(
|
||||
finance_statements
|
||||
+ [
|
||||
{
|
||||
"id": 3,
|
||||
"company_id": company_id,
|
||||
"date": pd.to_datetime(date(year, 1, 1)),
|
||||
"total_volume": float("NaN"),
|
||||
"ebit": 123.0,
|
||||
"ebitda": 235.0,
|
||||
"ebit_margin": float("NaN"),
|
||||
"total_balance": float("NaN"),
|
||||
"equity": float("NaN"),
|
||||
"debt": float("NaN"),
|
||||
"return_on_equity": float("NaN"),
|
||||
"capital_turnover_rate": float("NaN"),
|
||||
"current_liabilities": float("NaN"),
|
||||
"dividends": float("NaN"),
|
||||
"net_income": float("NaN"),
|
||||
"assets": float("NaN"),
|
||||
"long_term_debt": float("NaN"),
|
||||
"short_term_debt": short_term_debt,
|
||||
"revenue": float("NaN"),
|
||||
"cash_flow": float("NaN"),
|
||||
"current_assets": float("NaN"),
|
||||
}
|
||||
]
|
||||
)
|
||||
|
||||
expected_results["date"] = pd.to_datetime(expected_results["date"])
|
||||
pd.testing.assert_frame_equal(
|
||||
pd.DataFrame(
|
||||
[
|
||||
{
|
||||
"id": 1,
|
||||
"company_id": company_id,
|
||||
"date": pd.to_datetime(date(year, 1, 1)),
|
||||
"total_volume": float("NaN"),
|
||||
"ebit": 123.0,
|
||||
"ebitda": 235.0,
|
||||
"ebit_margin": float("NaN"),
|
||||
"total_balance": float("NaN"),
|
||||
"equity": float("NaN"),
|
||||
"debt": float("NaN"),
|
||||
"return_on_equity": float("NaN"),
|
||||
"capital_turnover_rate": float("NaN"),
|
||||
"current_liabilities": float("NaN"),
|
||||
"dividends": float("NaN"),
|
||||
"net_income": float("NaN"),
|
||||
"assets": float("NaN"),
|
||||
"long_term_debt": float("NaN"),
|
||||
"short_term_debt": short_term_debt,
|
||||
"revenue": float("NaN"),
|
||||
"cash_flow": float("NaN"),
|
||||
"current_assets": float("NaN"),
|
||||
}
|
||||
]
|
||||
),
|
||||
expected_results,
|
||||
df_prior,
|
||||
)
|
||||
|
||||
|
Reference in New Issue
Block a user