Beispiel #1
0
def test_teams():
    test_data = get_test_data('test_teams')
    for replay_id, ref_teams in test_data.items():
        replay_data = get_replay_data(file(get_replay_path(replay_id)))
        game_data = get_game_data(replay_data)
        teams = get_teams(game_data)
        print teams
        print ref_teams
        print (sorted(teams[TEAM_1])==sorted(ref_teams[TEAM_1]) and
                sorted(teams[TEAM_2])==sorted(ref_teams[TEAM_2]))
Beispiel #2
0
def dump_teams():
    replay_teams = {}
    for replay_id in get_replay_ids():
        try:
            replay_data = get_replay_data(file(get_replay_path(replay_id)))
            game_data = get_game_data(replay_data)
            if 'shuffle_players' in game_data['modes']:
                replay_teams[replay_id] = get_teams(game_data)
        except KeyboardInterrupt:
            raise
        except:
            traceback.print_exc()
            pass
    pprint(replay_teams)