Add test for anonymous AdaptIntent
parent
eb78d67ff7
commit
21425da543
|
@ -19,7 +19,7 @@ from adapt.intent import IntentBuilder
|
||||||
from mycroft.configuration import Configuration
|
from mycroft.configuration import Configuration
|
||||||
from mycroft.messagebus import Message
|
from mycroft.messagebus import Message
|
||||||
from mycroft.skills.intent_service import (ContextManager, IntentService,
|
from mycroft.skills.intent_service import (ContextManager, IntentService,
|
||||||
_get_message_lang)
|
_get_message_lang, AdaptIntent)
|
||||||
|
|
||||||
from test.util import base_config
|
from test.util import base_config
|
||||||
|
|
||||||
|
@ -327,3 +327,14 @@ class TestIntentServiceApi(TestCase):
|
||||||
self.intent_service.handle_get_adapt(msg)
|
self.intent_service.handle_get_adapt(msg)
|
||||||
reply = get_last_message(self.intent_service.bus)
|
reply = get_last_message(self.intent_service.bus)
|
||||||
self.assertEqual(reply.data['intent'], None)
|
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, "")
|
||||||
|
|
Loading…
Reference in New Issue