Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
aleksandarmijat committed May 22, 2024
1 parent 798a885 commit a4e9f59
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion rasa_sdk/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ def update_and_return_domain(
# If digest is invalid and no domain is available - raise the error
if (
not self.is_domain_digest_valid(payload_domain_digest)
and not payload_domain
and payload_domain is None
):
raise ActionMissingDomainException(action_name)

Expand Down
4 changes: 4 additions & 0 deletions tests/test_endpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ def test_server_webhook_handles_action_exception():
data = {
"next_action": "custom_action_exception",
"tracker": {"sender_id": "1", "conversation_id": "default"},
"domain": {},
}
request, response = app.test_client.post("/webhook", data=json.dumps(data))
assert response.status == 500
Expand All @@ -70,6 +71,7 @@ def test_server_webhook_custom_action_returns_200():
data = {
"next_action": "custom_action",
"tracker": {"sender_id": "1", "conversation_id": "default"},
"domain": {},
}
request, response = app.test_client.post("/webhook", data=json.dumps(data))
events = response.json.get("events")
Expand All @@ -82,6 +84,7 @@ def test_server_webhook_custom_async_action_returns_200():
data = {
"next_action": "custom_async_action",
"tracker": {"sender_id": "1", "conversation_id": "default"},
"domain": {},
}
request, response = app.test_client.post("/webhook", data=json.dumps(data))
events = response.json.get("events")
Expand Down Expand Up @@ -140,6 +143,7 @@ def test_server_webhook_custom_action_with_dialogue_stack_returns_200(
data = {
"next_action": "custom_action_with_dialogue_stack",
"tracker": {"sender_id": "1", "conversation_id": "default", **stack_state},
"domain": {},
}
_, response = app.test_client.post("/webhook", data=json.dumps(data))
events = response.json.get("events")
Expand Down
1 change: 1 addition & 0 deletions tests/tracing/instrumentation/test_tracing.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ def test_server_webhook_custom_action_is_instrumented(
"""Tests that the custom action is instrumented."""

data["next_action"] = action_name
data["domain"] = {}
app = ep.create_app(action_package, tracer_provider=tracer_provider)
_, response = app.test_client.post("/webhook", data=json.dumps(data))

Expand Down

0 comments on commit a4e9f59

Please sign in to comment.