Skip to content

Commit caa8fdf

Browse files
committed
tst: Add tests for error handling in action registration
1 parent b2e4721 commit caa8fdf

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

tests/test_action_error.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,28 @@ def fetch_user_profile():
7070

7171
chat >> "hello there!"
7272
chat << "I'm sorry, an internal error has occurred."
73+
74+
75+
def test_action_not_registered():
76+
"""Test that an error is raised when an action is not registered."""
77+
config = RailsConfig.from_content(
78+
"""
79+
define user express greeting
80+
"hello"
81+
82+
define flow
83+
user express greeting
84+
execute unregistered_action
85+
bot express greeting
86+
"""
87+
)
88+
chat = TestChat(
89+
config,
90+
llm_completions=[
91+
" express greeting",
92+
' "Hello John!"',
93+
],
94+
)
95+
96+
chat >> "hello there!"
97+
chat << "Action 'unregistered_action' not found."

0 commit comments

Comments
 (0)