Skip to content

Commit

Permalink
added test to make sure abstract method is still honored
Browse files Browse the repository at this point in the history
  • Loading branch information
twerkmeister committed Sep 14, 2023
1 parent 03aaf6c commit 2b48529
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/cdu/generator/test_command_generator.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from typing import Optional, List

import pytest

from rasa.cdu.commands import Command
from rasa.cdu.generator.command_generator import CommandGenerator
from rasa.cdu.commands.chit_chat_answer_command import ChitChatAnswerCommand
Expand Down Expand Up @@ -31,3 +33,10 @@ def test_command_generator_catches_processing_errors():
assert len(commands[0]) == 0
assert len(commands[1]) == 1
assert commands[1][0]["command"] == ChitChatAnswerCommand.command()


def test_command_generator_still_throws_not_implemented_error():
# This test can be removed if the predict_commands method stops to be abstract
generator = CommandGenerator()
with pytest.raises(NotImplementedError):
generator.process([Message.build("test")], FlowsList([]))

0 comments on commit 2b48529

Please sign in to comment.