Example #1
0
 def test_double_chance(self):
     for r in TestClass.rho:
         for s in TestClass.score:
             for st in TestClass.sup_ttg:
                 print(r, s, st)
                 doc_v1 = cal_soccer_odds()
                 doc_v1.set_value(st, s, [1, r])
                 doc_v2 = DynamicOddsCal(st, s, [1, r])
                 assert doc_v1.double_chance() == doc_v2.double_chance()
Example #2
0
 def test_had(self):
     doc_v2 = DynamicOddsCal()
     doc_v1 = cal_soccer_odds()
     for r in TestClass.rho:
         for s in TestClass.score:
             for st in TestClass.sup_ttg:
                 print(r, s, st)
                 doc_v1.set_value(st, s, [1, r])
                 doc_v2.refresh(sup_ttg=st,
                                present_socre=s,
                                adj_params=[1, r])
                 assert doc_v1.had() == doc_v2.had()
Example #3
0
 def test_exact_score(self):
     doc_v1 = cal_soccer_odds()
     doc_v2 = DynamicOddsCal([0, 0], [0, 0], [1, 0])
     for r in TestClass.rho:
         for s in TestClass.score:
             for st in TestClass.sup_ttg:
                 for ts in TestClass.target_scores:
                     doc_v2.refresh(sup_ttg=st,
                                    present_socre=s,
                                    adj_params=[1, r])
                     print( 'rho = %f, score = %f, %f , targets = %f, %f,  ssssss= %f' %(\
                         r, s[0], s[1], ts[0], ts[1], doc_v2.exact_score(ts[0], ts[1])[selection_type.YES] ) )
Example #4
0
 def test_over_under(self):
     doc_v1 = cal_soccer_odds()
     doc_v2 = DynamicOddsCal([0, 0], [0, 0], [1, 0])
     for r in TestClass.rho:
         for s in TestClass.score:
             for st in TestClass.sup_ttg:
                 for l in TestClass.line:
                     print(r, s, st, l)
                     doc_v1.set_value(st, s, [1, r])
                     doc_v2.refresh(sup_ttg=st,
                                    present_socre=s,
                                    adj_params=[1, r])
                     assert doc_v1.over_under(l) == doc_v2.over_under(l)
Example #5
0
 def test_exact_ttg(self):
     doc_v1 = cal_soccer_odds()
     doc_v2 = DynamicOddsCal([0, 0], [0, 0], [1, 0])
     for r in TestClass.rho:
         for s in TestClass.score:
             for st in TestClass.sup_ttg:
                 for l in range(-20, 20):
                     print(r, s, st, l)
                     doc_v1.set_value(st, s, [1, r])
                     doc_v2.refresh(sup_ttg=st,
                                    present_socre=s,
                                    adj_params=[1, r])
                     assert doc_v1.exact_totals(l) == doc_v2.exact_ttg(l)
Example #6
0
 def __init__(self):
     self.odds_tool_full_time = cal_soccer_odds()
     self.odds_tool_1st_half = cal_soccer_odds()
     self.odds_tool_2nd_half = cal_soccer_odds()
Example #7
0
 def __init__(self):
     self.odds_tool = cal_soccer_odds()