Example #1
0
    def test_get_live(self):
        dota = Rest('config.yaml', ignore_limiter=True).OpenDota
        live = dota.get_live()

        assert len(live) >= 0
        if len(live) > 0:
            assert len(live[0]['players']) > 0
Example #2
0
    def test_get_player_heroes(self):
        dota = Rest('config.yaml', ignore_limiter=True).OpenDota
        pro_players = dota.get_pro_players()
        player_heroes = dota.get_player_heroes(pro_players[0]['account_id'])

        assert len(player_heroes) > 0
        assert 'hero_id' in player_heroes[0]
Example #3
0
    def test_get_match(self):
        pubg = Rest('config.yaml', ignore_limiter=True).Pubg
        player = pubg.get_player('account.d50fdc18fcad49c691d38466bed6f8fd')
        match = pubg.get_match(
            player['data']['relationships']['matches']['data'][0]['id']
        )

        assert 'data' in match
Example #4
0
    def test_get_match_timeline(self):
        riot = Rest('config.yaml', ignore_limiter=True).Riot

        summoner = riot.get_summoner_by_name('pandaxcentric')
        matches = riot.get_matches_for_account(summoner['accountId'])

        timeline = riot.get_match_timeline(matches['matches'][0]['gameId'])

        assert timeline['frameInterval'] > 0
Example #5
0
    def test_get_player_heroes_parameters(self):
        dota = Rest('config.yaml', ignore_limiter=True).OpenDota
        pro_players = dota.get_pro_players()

        parameters = {
            'limit': 1,
            'offset': 1,
            'hero_id': 2
        }

        player_heroes = dota.get_player_heroes(pro_players[0]['account_id'], parameters)
        assert player_heroes[0]['games'] <= 1
Example #6
0
    def test_champion_rotations(self):
        riot = Rest('config.yaml', ignore_limiter=True).Riot
        rotations = riot.champion_rotations()

        assert len(rotations['freeChampionIds']) > 0
Example #7
0
 def test_champion_mastery_score_json_config(self):
     config_json = {'riot': {'key_id': '<hand enter key before running>'}}
     riot = Rest(config_json, ignore_limiter=True).Riot
     summoner = riot.get_summoner_by_name('pandaxcentric')
     mastery = riot.champion_mastery_score(summoner['id'])
     assert mastery >= 0
Example #8
0
 def test_champion_mastery_score(self):
     riot = Rest('config.yaml', ignore_limiter=True).Riot
     summoner = riot.get_summoner_by_name('pandaxcentric')
     mastery = riot.champion_mastery_score(summoner['id'])
     assert mastery >= 0
Example #9
0
 def test_champion_masteries(self):
     riot = Rest('config.yaml', ignore_limiter=True).Riot
     summoner = riot.get_summoner_by_name('pandaxcentric')
     champions = riot.champion_masteries(summoner['id'])
     assert len(champions) >= 0
Example #10
0
    def test_get_hero_matchups(self):
        dota = Rest('config.yaml', ignore_limiter=True).OpenDota
        matchups = dota.get_hero_matchups(2)

        assert len(matchups) > 0
Example #11
0
 def test_get_item_timings_both(self):
     dota = Rest('config.yaml', ignore_limiter=True).OpenDota
     scenarios = dota.get_item_timings({'hero_id': 120, 'item': 'ancient_janggo'})
     assert len(scenarios) > 1
Example #12
0
 def test_hello_world(self):
     riot = Rest('config.yaml', ignore_limiter=True).Riot
     hello = riot.hello_world()
     assert hello['id'] == 585897
Example #13
0
 def test_get_featured_games(self):
     riot = Rest('config.yaml', ignore_limiter=True).Riot
     featured = riot.get_featured_games()
     assert len(featured['gameList']) > 0
Example #14
0
 def test_get_teams(self):
     dota = Rest('config.yaml', ignore_limiter=True).OpenDota
     teams = dota.get_teams()
     assert len(teams) > 0
     assert 'team_id' in teams[0]
Example #15
0
    def test_get_match(self):
        dota = Rest('config.yaml', ignore_limiter=True).OpenDota
        match_id = dota.get_pro_matches()[0]['match_id']
        match = dota.get_match(match_id)

        assert match_id == match['match_id']
Example #16
0
 def test_get_team_matches(self):
     dota = Rest('config.yaml', ignore_limiter=True).OpenDota
     team = teams = dota.get_teams()[0]
     matches = dota.get_team_matches(team['team_id'])
     assert len(matches) > 0
Example #17
0
    def test_get_misc_scenarios_param(self):
        dota = Rest('config.yaml', ignore_limiter=True).OpenDota
        scenarios = dota.get_misc_scenarios({'scenario': 'courier_kill'})

        assert len(scenarios) > 0
Example #18
0
    def test_get_misc_scenarios(self):
        dota = Rest('config.yaml', ignore_limiter=True).OpenDota
        scenarios = dota.get_misc_scenarios()

        assert len(scenarios) > 0
Example #19
0
    def test_get_lane_roles_both(self):
        dota = Rest('config.yaml', ignore_limiter=True).OpenDota
        scenarios = dota.get_lane_roles({'hero_id': 62, 'lane_role': 1})

        assert len(scenarios) > 0
Example #20
0
 def test_get_summoner_by_name(self):
     riot = Rest('config.yaml', ignore_limiter=True).Riot
     summoner = riot.get_summoner_by_name('pandaxcentric')
     assert 'id' in summoner
Example #21
0
    def test_get_matches_for_account(self):
        riot = Rest('config.yaml', ignore_limiter=True).Riot
        summoner = riot.get_summoner_by_name('pandaxcentric')
        matches = riot.get_matches_for_account(summoner['accountId'])

        assert len(matches['matches']) > 0
    def test_get_leaderboards(self):
        r6s = Rest('config.yaml', ignore_limiter=True).Rainbow6Siege
        leaders = r6s.get_leaderboards('pc', page=1)

        assert len(leaders) == 100
    def test_get_high_level_player_status(self):
        r6s = Rest('config.yaml', ignore_limiter=True).Rainbow6Siege
        player_stats = r6s.get_high_level_player_status('SanalsBae', 'pc')

        assert player_stats[0][
            'ubisoft_id'] == 'bedbbe83-015a-4e6f-babc-580c6e6ff9f3'
Example #24
0
    def test_get_item_timings_hero(self):
        dota = Rest('config.yaml', ignore_limiter=True).OpenDota
        scenarios = dota.get_item_timings({'hero_id': 120})

        assert len(scenarios) > 0
    def test_get_player_operators(self):
        r6s = Rest('config.yaml', ignore_limiter=True).Rainbow6Siege
        info = r6s.get_player_operators('barzY-YT', 'uplay')

        assert len(info['operator_records']) > 0
Example #26
0
 def test_get_player_wardmap(self):
     dota = Rest('config.yaml', ignore_limiter=True).OpenDota
     pro_players = dota.get_pro_players()
     wardmap = dota.get_player_wardmap(pro_players[0]['account_id'])
     assert 'obs' in wardmap
    def test_get_player_stats(self):
        r6s = Rest('config.yaml', ignore_limiter=True).Rainbow6Siege
        player_stats = r6s.get_player_stats(
            'bedbbe83-015a-4e6f-babc-580c6e6ff9f3')

        assert player_stats['username'] == 'SanalsBae'
Example #28
0
 def test_region_default(self):
     riot = Rest('config.yaml', ignore_limiter=True).Riot
     assert riot.rest_api == "https://na1.api.riotgames.com"
    def test_get_player_info(self):
        r6s = Rest('config.yaml', ignore_limiter=True).Rainbow6Siege
        info = r6s.get_player_info('barzY-YT', 'uplay')

        assert info['player']['username'] == 'barzY-YT'
Example #30
0
 def test_region_different(self):
     riot = Rest('config.yaml', ignore_limiter=True, region='test').Riot
     assert riot.rest_api == "https://test.api.riotgames.com"