def test_get_game_ids(date_response):
    """ Check to see that all the espn game id's for that day are correct"""
    game_ids = [
        '400814970', '400814971', '400814972', '400814973', '400814974',
        '400814975', '400814976', '400814977', '400814978', '400814979',
        '400814980', '400814981'
    ]

    assert espn_pbp.get_game_ids(date_response) == game_ids
Пример #2
0
    def get_espn_ids(self, games):
        """
        Get espn game ids for all games that day

        :param list games: games today

        :return: Games with corresponding espn game ids
        """
        # Get all espn info
        response = espn_pbp.get_espn_date(self.date)
        game_ids = espn_pbp.get_game_ids(response)
        espn_games = espn_pbp.get_teams(response)

        # Match up
        for i in range(len(games)):
            for j in range(len(espn_games)):
                if games[i]['home_team'] in espn_games[j] or games[i]['away_team'] in espn_games[j]:
                    games[i]['espn_id'] = game_ids[j]

        return games