def test_analyze_with_one_successful_suggestions_response(self): expected_analysis = ['success(1-1)'] request = Request('asker', 'What is Coveo?', 'link', 'https://www.coveo.com/') suggestion = Suggestion('link', 'https://www.coveo.com/') suggestions_responses_analyzer = SuggestionsResponsesAnalyzer( [Scenario([request])], [[SuggestionsResponse([suggestion], timedelta(seconds=0))]]) self.assertEquals(expected_analysis, suggestions_responses_analyzer.analyze_scenarios())
def test_analyze(self): expected_analysis = [ 'fail', 'success(1-1)', 'success(1-1)', 'success', 'fail', 'fail', 'fail', 'fail', 'success', 'fail', 'fail', 'success(1-2)', 'success(1-2)', 'fail', 'fail', 'fail', 'fail', 'success', 'fail', 'success', 'fail' ] suggestions_responses_analyzer = SuggestionsResponsesAnalyzer( self._scenarios, self._suggestions_responses_for_each_scenario) self.assertEquals(expected_analysis, suggestions_responses_analyzer.analyze_scenarios())