Skip to content

Commit

Permalink
implement PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
Tawakalt committed Feb 9, 2024
1 parent 5a7c1b8 commit 66edd17
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
11 changes: 11 additions & 0 deletions tests/test_endpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,17 @@ def test_server_list_actions_returns_200():
assert response.status == 200
assert len(response.json) == 4

# ENSURE TO UPDATE AS MORE ACTIONS ARE ADDED IN OTHER TESTS
expected = [
# defined in tests/test_actions.py
{"name": "custom_async_action"},
{"name": "custom_action"},
{"name": "custom_action_exception"},
# defined in tests/tracing/instrumentation/conftest.py
{"name": "mock_validation_action"},
]
assert response.json == expected


def test_server_webhook_unknown_action_returns_404():
data = {
Expand Down
13 changes: 5 additions & 8 deletions tests/tracing/instrumentation/test_validation_action.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
from typing import Sequence, Optional
from typing import List, Sequence

import pytest
from opentelemetry.sdk.trace import ReadableSpan, TracerProvider
from opentelemetry.sdk.trace.export.in_memory_span_exporter import InMemorySpanExporter

from rasa_sdk.tracing.instrumentation import instrumentation
from tests.tracing.instrumentation.conftest import (
MockValidationAction,
# MockValidationActionSubClass,
)
from tests.tracing.instrumentation.conftest import MockValidationAction
from rasa_sdk import Tracker
from rasa_sdk.executor import CollectingDispatcher
from rasa_sdk.events import SlotSet
from rasa_sdk.events import SlotSet, EventType


@pytest.mark.parametrize(
Expand All @@ -29,8 +26,8 @@ async def test_tracing_action_executor_run(
tracer_provider: TracerProvider,
span_exporter: InMemorySpanExporter,
previous_num_captured_spans: int,
events: Optional[str],
expected_slots_to_validate: Optional[str],
events: List[EventType],
expected_slots_to_validate: str,
) -> None:
component_class = MockValidationAction

Expand Down

0 comments on commit 66edd17

Please sign in to comment.