Пример #1
0
 def test_few_companies_exists(self):
     input_data = {
         'SkyBet': {
             'country1': 'odd1.1',
             'country2': 'odd1.2',
             'country3': 'odd1.3',
         },
         'Bet365': {
             'country1': 'odd2.1',
             'country2': 'odd2.2',
             'country3': 'odd2.3',
         },
         'Paddy': {
             'country1': 'odd3.1',
             'country2': 'odd3.2',
         }
     }
     self.assertEqual(
         {
             'keys': ['Bet365', 'Paddy', 'SkyBet'],
             'data': [
                 ('country1', ['odd2.1', 'odd3.1', 'odd1.1']),
                 ('country2', ['odd2.2', 'odd3.2', 'odd1.2']),
                 ('country3', ['odd2.3', 'odd1.3']),
             ]
         },
         merge_results(input_data)
     )
Пример #2
0
 def test_one_company_exists(self):
     input_data = {
         'SkyBet': {
             'country1': 'odd1',
             'country2': 'odd2',
             'country3': 'odd3',
         }
     }
     self.assertEqual(
         {
             'keys': ['SkyBet'],
             'data': [
                 ('country1', ['odd1']),
                 ('country2', ['odd2']),
                 ('country3', ['odd3']),
             ]
         },
         merge_results(input_data)
     )
Пример #3
0
 def test_empty_data(self):
     self.assertEqual(
         {'keys': [], 'data': []},
         merge_results(dict())
     )
Пример #4
0
def save_file():
    data = merge_results(dict(app.results))
    return send_file(
        filename_or_fp=get_attachment(data),
        mimetype='application/vnd.ms-excel',
    )
Пример #5
0
def refresh():
    """
    Returns table in current state without updating anything
    """
    data = merge_results(dict(app.results))
    return render_template('table.html', data=data)