Example #1
0
File: utils.py Project: xrile/fjord
def get_suggestions(feedback, request=None):
    """Given a feedback response and an optional HTTP request, returns an
    ordered list of suggestions

    """
    suggestions = []

    for prov in get_suggesters():
        try:
            suggestions.extend(prov.get_suggestions(feedback, request))
        except Exception:
            logger.exception('Error in provider {0}'.format(
                prov.__class__.__name__))

    return suggestions
Example #2
0
def get_suggestions(feedback, request=None):
    """Given a feedback response and an optional HTTP request, returns an
    ordered list of suggestions

    """
    suggestions = []

    for prov in get_suggesters():
        try:
            suggestions.extend(prov.get_suggestions(feedback, request))
        except Exception:
            logger.exception('Error in provider {0}'.format(
                prov.__class__.__name__))

    return suggestions
Example #3
0
 def test_load(self):
     dummy_providers = [
         prov for prov in get_suggesters()
         if isinstance(prov, DummySuggester)
     ]
     assert len(dummy_providers) == 1
Example #4
0
 def test_load(self):
     dummy_providers = [
         prov for prov in get_suggesters()
         if isinstance(prov, DummySuggester)
     ]
     assert len(dummy_providers) == 1