feat(CORE-001D): close remaining boundary cleanup slices
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from datetime import date
|
||||
from decimal import Decimal
|
||||
|
||||
import pytest
|
||||
|
||||
@@ -10,6 +11,24 @@ from app.services.backtesting.ui_service import BacktestPageService
|
||||
from tests.helpers_backtest_sources import StaticBacktestSource
|
||||
|
||||
|
||||
def test_backtest_page_service_accepts_decimal_boundary_values() -> None:
|
||||
service = BacktestPageService()
|
||||
|
||||
result = service.run_read_only_scenario(
|
||||
symbol="GLD",
|
||||
start_date=date(2024, 1, 2),
|
||||
end_date=date(2024, 1, 8),
|
||||
template_slug="protective-put-atm-12m",
|
||||
underlying_units=Decimal("1000.0"),
|
||||
loan_amount=Decimal("68000.0"),
|
||||
margin_call_ltv=Decimal("0.75"),
|
||||
)
|
||||
|
||||
assert result.scenario.initial_portfolio.underlying_units == 1000.0
|
||||
assert result.scenario.initial_portfolio.loan_amount == 68000.0
|
||||
assert result.scenario.initial_portfolio.margin_call_ltv == 0.75
|
||||
|
||||
|
||||
def test_backtest_page_service_uses_fixture_window_for_deterministic_run() -> None:
|
||||
service = BacktestPageService()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user