Add test for anonymous AdaptIntent

pull/2767/head
Åke Forslund 2020-11-24 11:02:52 +01:00
parent eb78d67ff7
commit 21425da543
1 changed files with 12 additions and 1 deletions

View File

@ -19,7 +19,7 @@ from adapt.intent import IntentBuilder
from mycroft.configuration import Configuration
from mycroft.messagebus import Message
from mycroft.skills.intent_service import (ContextManager, IntentService,
_get_message_lang)
_get_message_lang, AdaptIntent)
from test.util import base_config
@ -327,3 +327,14 @@ class TestIntentServiceApi(TestCase):
self.intent_service.handle_get_adapt(msg)
reply = get_last_message(self.intent_service.bus)
self.assertEqual(reply.data['intent'], None)
class TestAdaptIntent(TestCase):
"""Test the AdaptIntent wrapper."""
def test_named_intent(self):
intent = AdaptIntent("CallEaglesIntent")
self.assertEqual(intent.name, "CallEaglesIntent")
def test_unnamed_intent(self):
intent = AdaptIntent()
self.assertEqual(intent.name, "")