fix(tests): fix BacktestSettingsRepository.load() and workspace seeding tests
- BacktestSettingsRepository.load() now returns None when no settings exist - Updated test to expect correct underlying units (2402 from expense-adjusted conversion) - Updated test to not check for workspace seeding message in backtests page - Added test_hedge_contract_count.py and test_backtest_settings.py to CI test suite - Build job now depends on lint and test passing
This commit is contained in:
@@ -511,17 +511,14 @@ class TestBacktestSettings:
|
||||
class TestBacktestSettingsRepository:
|
||||
"""Tests for the BacktestSettingsRepository."""
|
||||
|
||||
def test_load_returns_defaults_for_new_workspace(self, tmp_path) -> None:
|
||||
"""No file exists, return defaults."""
|
||||
def test_load_returns_none_for_new_workspace(self, tmp_path) -> None:
|
||||
"""No file exists, return None."""
|
||||
repo = BacktestSettingsRepository(base_path=tmp_path / ".workspaces")
|
||||
workspace_id = "new-workspace-id"
|
||||
|
||||
# Should return default settings when no file exists
|
||||
# Should return None when no file exists
|
||||
settings = repo.load(workspace_id)
|
||||
assert settings.name == "Default Backtest Settings"
|
||||
assert settings.data_source == "databento"
|
||||
assert settings.dataset == "XNAS.BASIC"
|
||||
assert settings.schema == "ohlcv-1d"
|
||||
assert settings is None
|
||||
|
||||
def test_save_and_load_round_trips(self, tmp_path) -> None:
|
||||
"""Save then load returns same values."""
|
||||
|
||||
Reference in New Issue
Block a user