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:
@@ -21,23 +21,21 @@ class BacktestSettingsRepository:
|
||||
self.base_path = Path(base_path)
|
||||
self.base_path.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
def load(self, workspace_id: str) -> BacktestSettings:
|
||||
def load(self, workspace_id: str) -> BacktestSettings | None:
|
||||
"""Load backtest settings for a workspace.
|
||||
|
||||
Args:
|
||||
workspace_id: The workspace ID to load settings for
|
||||
|
||||
Returns:
|
||||
BacktestSettings: The loaded settings
|
||||
BacktestSettings: The loaded settings, or None if no settings exist
|
||||
|
||||
Raises:
|
||||
FileNotFoundError: If settings file doesn't exist
|
||||
ValueError: If settings file is invalid
|
||||
"""
|
||||
settings_path = self._settings_path(workspace_id)
|
||||
if not settings_path.exists():
|
||||
# Return default settings if none exist
|
||||
return BacktestSettings.create_default()
|
||||
return None
|
||||
|
||||
try:
|
||||
with open(settings_path) as f:
|
||||
|
||||
Reference in New Issue
Block a user