Пример #1
0
 def test_find_answer_function__does_not_exist(self):
     """Verify logic of find_answer_function for unrecognized intent.
     """
     mock_parsed_query = Mock(name='parsed_query', intent='foo_bar_query')
     fact_query = FactQuery(parsed_query=mock_parsed_query)
     fn = fact_query._find_answer_function()
     self.assertIsNone(fn)
Пример #2
0
 def test_find_answer_function__fact(self):
     """Verify logic of find_answer_function for fact intent.
     """
     mock_parsed_query = Mock(name='parsed_query', intent='animal_eat_fact')
     fact_query = FactQuery(parsed_query=mock_parsed_query)
     fn = fact_query._find_answer_function()
     self.assertEqual(fn, fact_query._animal_attribute_query)
Пример #3
0
 def test_find_answer_function__ci(self):
     """Verify logic of find_answer_function for query intent that is capitalized.
     """
     mock_parsed_query = Mock(name='parsed_query',
                              intent='ANIMAL_EAT_QUERY')
     fact_query = FactQuery(parsed_query=mock_parsed_query)
     fn = fact_query._find_answer_function()
     self.assertEqual(fn, fact_query._animal_eat_query)