def test_property_error(self): """ result should be removed from list if there is an error in the handler properties """ test_result = { "not_course": "asdasda", "not_id": "rthrthretht" } new_result = SearchResultProcessor.process_result(test_result, "fake search pattern", None) self.assertIsNone(new_result)
def test_property_error(self): """ result should be removed from list if there is an error in the handler properties """ test_result = { "not_course": "asdasda", "not_id": "rthrthretht" } new_result = SearchResultProcessor.process_result(test_result, "fake search pattern", None) self.assertIsNone(new_result)
def test_removal(self): """ make sure that the override of should remove let's the application prevent access to a result """ test_result = { "course": "remove_course", "id": "remove_id", "remove_me": True } new_result = SearchResultProcessor.process_result(test_result, "fake search pattern", None) self.assertIsNone(new_result)
def test_removal(self): """ make sure that the override of should remove let's the application prevent access to a result """ test_result = { "course": "remove_course", "id": "remove_id", "remove_me": True } new_result = SearchResultProcessor.process_result(test_result, "fake search pattern", None) self.assertIsNone(new_result)
def test_additional_property(self): """ make sure the addition properties are returned """ test_result = {"course": "testmetestme", "id": "herestheid"} new_result = SearchResultProcessor.process_result( test_result, "fake search pattern", None) self.assertEqual(new_result, test_result) self.assertEqual(test_result["url"], "/courses/testmetestme/jump_to/herestheid") self.assertIsNone(test_result["excerpt"]) self.assertEqual(test_result["additional_property"], "Should have an extra value")
def test_additional_property(self): """ make sure the addition properties are returned """ test_result = { "course": "testmetestme", "id": "herestheid" } new_result = SearchResultProcessor.process_result(test_result, "fake search pattern", None) self.assertEqual(new_result, test_result) self.assertEqual(test_result["url"], "/courses/testmetestme/jump_to/herestheid") self.assertIsNone(test_result["excerpt"]) self.assertEqual(test_result["additional_property"], "Should have an extra value")