def test_is_canfulfill_intent_not_match_intent():
    test_canfulfill_intent_name = "TestIntent"
    test_canfulfill_handler_input = HandlerInput(
        request_envelope=RequestEnvelope(request=CanFulfillIntentRequest(
            intent=Intent(name=test_canfulfill_intent_name))))

    intent_name_wrapper = is_intent_name(test_canfulfill_intent_name)
    assert not intent_name_wrapper(
        test_canfulfill_handler_input), "is_intent_name matcher matched with the " \
                                        "incorrect request type"
def test_is_canfulfill_intent_name_match():
    test_canfulfill_intent_name = "TestIntent"
    test_handler_input = HandlerInput(
        request_envelope=RequestEnvelope(request=CanFulfillIntentRequest(
            intent=Intent(name=test_canfulfill_intent_name))))

    canfulfill_intent_name_wrapper = is_canfulfill_intent_name(test_canfulfill_intent_name)
    assert canfulfill_intent_name_wrapper(
        test_handler_input), "is_canfulfill_intent_name matcher didn't match with the " \
                             "correct intent name"
예제 #3
0
 def setUp(self, mock_cache, mock_enumerator):
     self.test_template_name = 'test'
     self.test_dir_path = '.'
     self.test_enumerator = mock_enumerator.return_value
     mock_cache.get.return_value = None
     self.cache = mock_cache
     self.test_handler_input = HandlerInput(
         request_envelope=RequestEnvelope(request=CanFulfillIntentRequest(
             locale='en-GB')))
     self.test_loader = FileSystemTemplateLoader(
         dir_path=self.test_dir_path,
         enumerator=self.test_enumerator,
         cache=mock_cache,
         encoding='utf-8')
예제 #4
0
 def setUp(self):
     self.test_enumerator = LocaleTemplateEnumerator()
     self.test_template_name = 'test_template'
     self.test_handler_input = HandlerInput(
         request_envelope=RequestEnvelope(request=CanFulfillIntentRequest(
             locale='en-GB')))