Пример #1
0
def populate_games():
    with app.open_resource('./testing/data/games.json') as gamedata:
        games = json.load(gamedata)['games']
        for g in games:
            Game.add_game(teams=g['teams'],
                          court=int(g['court']),
                          time=g['time'])
            scrs = g['score'].split(' ')
            Game.update_game(int(g['court']), g['time'],
                             g['winner'], scrs[0], scrs[1])