testing new features

This commit is contained in:
2026-07-22 12:12:09 +03:00
parent 3cc8e94863
commit 9ed71cbc58
15 changed files with 1201 additions and 40 deletions
+13 -2
View File
@@ -5,6 +5,8 @@ import pytest
from cashflow_model import (
Account,
Asset,
CurrencyConverter,
ExchangeRate,
FinancialModel,
Liability,
RecurringCashflow,
@@ -16,9 +18,10 @@ from cashflow_model import (
def sample_model() -> FinancialModel:
acc_id = uuid4()
return FinancialModel(
base_currency="RUB",
accounts=[
Account(id=acc_id, name="Основной счёт", currency="USD", balance=5000.0),
Account(name="Сбережения", currency="USD", balance=10000.0),
Account(id=acc_id, name="Основной счёт", currency="RUB", balance=5000.0),
Account(name="Сбережения", currency="RUB", balance=10000.0),
],
transactions=[
Transaction(
@@ -48,9 +51,17 @@ def sample_model() -> FinancialModel:
liabilities=[
Liability(name="Кредит", balance=20000.0, interest=5.0, payment=500.0),
],
exchange_rates=[
ExchangeRate(from_currency="USD", to_currency="RUB", rate=80.0),
],
)
@pytest.fixture
def empty_model() -> FinancialModel:
return FinancialModel()
@pytest.fixture
def sample_converter() -> CurrencyConverter:
return CurrencyConverter([ExchangeRate(from_currency="USD", to_currency="RUB", rate=80.0)])