Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions tests/test_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ def test_intent_from_function_name(parser):
Tests that concepts are correctly extracted from a function name.
"""
name = "get_user_by_id_and_update_status"
# 'get' -> wisdom, 'update' -> power
expected_concepts = {"wisdom", "power", "status"}
# 'get' -> wisdom, 'update' -> power, 'status' -> wisdom
expected_concepts = {"wisdom", "power"}
concepts = parser.get_intent_concepts(name, None)
assert set(concepts) == expected_concepts

Expand Down Expand Up @@ -102,7 +102,8 @@ def test_execution_error_handling(parser):
log_error("Division by zero")
raise ValueError("Invalid operation")
"""
expected_concepts = {"justice", "love", "power"}
# try -> justice, except -> love, log -> wisdom, raise -> power
expected_concepts = {"justice", "love", "power", "wisdom"}
body = ast.parse(code).body
_, concepts = parser.get_execution_map(body)
assert set(concepts) == expected_concepts