From 2b48529c845c6735ccadb4c99ce4f9bc3e9a5c72 Mon Sep 17 00:00:00 2001 From: Thomas Werkmeister Date: Thu, 14 Sep 2023 13:01:02 +0200 Subject: [PATCH] added test to make sure abstract method is still honored --- tests/cdu/generator/test_command_generator.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/cdu/generator/test_command_generator.py b/tests/cdu/generator/test_command_generator.py index d72b628901db..62eeb5d2c1be 100644 --- a/tests/cdu/generator/test_command_generator.py +++ b/tests/cdu/generator/test_command_generator.py @@ -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 @@ -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([]))