mirror of
https://github.com/bytedance/deer-flow.git
synced 2026-05-21 23:46:50 +00:00
fix(task): tolerate invalid default config in usage cache
This commit is contained in:
@@ -1214,11 +1214,12 @@ def test_terminal_event_usage_none_when_no_records(monkeypatch):
|
||||
assert completed[0]["usage"] is None
|
||||
|
||||
|
||||
def test_subagent_usage_cache_is_skipped_when_config_file_is_missing(monkeypatch):
|
||||
@pytest.mark.parametrize("error", [FileNotFoundError("missing config"), ValueError("invalid config")])
|
||||
def test_subagent_usage_cache_is_skipped_when_default_config_cannot_load(monkeypatch, error):
|
||||
monkeypatch.setattr(
|
||||
task_tool_module,
|
||||
"get_app_config",
|
||||
MagicMock(side_effect=FileNotFoundError("missing config")),
|
||||
MagicMock(side_effect=error),
|
||||
)
|
||||
|
||||
assert task_tool_module._token_usage_cache_enabled(None) is False
|
||||
|
||||
Reference in New Issue
Block a user