def test_predictions(self, predthread): predictions = predthread.predictions() assert predictions['cbeaz17'].exactly_equals(MatchResult(2, 1)) assert predictions['K3GGY'].exactly_equals(MatchResult(5, 5)) assert predictions['MyoMike'].exactly_equals(MatchResult(1, 2)) assert predictions['DrShaftmanPhD'].exactly_equals(MatchResult(2, 1)) assert predictions['Siteyaself'].exactly_equals(MatchResult(1, 2)) assert predictions['kyleandrew_7'].exactly_equals(MatchResult(2, 2)) assert "walterrobot" not in predictions.keys()
def test_init(self): match_result = MatchResult(0, 0)
def not_same_result_match_results(request): return MatchResult(*request.param[0]), MatchResult(*request.param[1])
def not_exactly_equal_match_results(request): return MatchResult(*request.param[0]), MatchResult(*request.param[1])
def extraction_case(request): return MatchResult(*request.param[0]), request.param[1], request.param[2]
) @fixture(scope="module") def predthread11() -> PredictionThread: return PredictionThread( home_goals=1, away_goals=2, saints_are_home=False, url=URL_WEEK11_2020_21, client_id=client_id, client_secret=client_secret, user_agent=user_agent ) predictions_and_points_params = ( ((MatchResult(0, 0), MatchResult(0, 0)), 3), ((MatchResult(1, 0), MatchResult(1, 0)), 3), ((MatchResult(0, 1), MatchResult(0, 1)), 3), ((MatchResult(1, 1), MatchResult(1, 1)), 3), ((MatchResult(0, 0), MatchResult(1, 1)), 1), ((MatchResult(2, 0), MatchResult(4, 1)), 1), ((MatchResult(2, 0), MatchResult(2, 5)), 0), ((MatchResult(2, 0), MatchResult(3, 3)), 0), ) @fixture(params=predictions_and_points_params) def predictions_and_points(request): predicted = request.param[0][0] true = request.param[0][1] points = request.param[1] return predicted, true, points