mirror of
https://github.com/bytedance/deer-flow.git
synced 2026-05-06 00:38:23 +00:00
- Move all unit tests from tests/ to tests/unittest/ - Add tests/e2e/ directory for end-to-end tests - Update conftest.py for new test structure - Add new tests for auth dependencies, policies, route injection - Add new tests for run callbacks, create store, execution artifacts - Remove obsolete tests for deleted persistence layer Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
18 lines
734 B
Python
18 lines
734 B
Python
from types import SimpleNamespace
|
|
|
|
import pytest
|
|
|
|
from deerflow.skills.security_scanner import scan_skill_content
|
|
|
|
|
|
@pytest.mark.anyio
|
|
async def test_scan_skill_content_blocks_when_model_unavailable(monkeypatch):
|
|
config = SimpleNamespace(skill_evolution=SimpleNamespace(moderation_model_name=None))
|
|
monkeypatch.setattr("deerflow.skills.security_scanner.get_app_config", lambda: config)
|
|
monkeypatch.setattr("deerflow.skills.security_scanner.create_chat_model", lambda **kwargs: (_ for _ in ()).throw(RuntimeError("boom")))
|
|
|
|
result = await scan_skill_content("---\nname: demo-skill\ndescription: demo\n---\n", executable=False)
|
|
|
|
assert result.decision == "block"
|
|
assert "manual review required" in result.reason
|