Фикс состояния
This commit is contained in:
22
tests/unit_tests/rag/test_explain_intent_builder.py
Normal file
22
tests/unit_tests/rag/test_explain_intent_builder.py
Normal file
@@ -0,0 +1,22 @@
|
||||
from app.modules.rag.explain.intent_builder import ExplainIntentBuilder
|
||||
|
||||
|
||||
def test_explain_intent_builder_extracts_route_symbol_and_file_hints() -> None:
|
||||
builder = ExplainIntentBuilder()
|
||||
|
||||
intent = builder.build("Explain how /users/{user_id} reaches UserService.get_user in app/api/users.py")
|
||||
|
||||
assert "/users/{user_id}" in intent.hints.endpoints
|
||||
assert "UserService.get_user" in intent.hints.symbols
|
||||
assert "app/api/users.py" in intent.hints.paths
|
||||
assert intent.expected_entry_types == ["http"]
|
||||
assert intent.include_tests is False
|
||||
assert intent.depth == "medium"
|
||||
|
||||
|
||||
def test_explain_intent_builder_enables_tests_when_user_asks_for_them() -> None:
|
||||
builder = ExplainIntentBuilder()
|
||||
|
||||
intent = builder.build("Покажи как это тестируется в pytest и какие tests покрывают UserService")
|
||||
|
||||
assert intent.include_tests is True
|
||||
Reference in New Issue
Block a user