Beispiel #1
0
def intersecting_games(*args):
    api = steam.SteamAPI()

    games_list = [api.get_games(steamid) for steamid in args]
    game_ids = [g.keys() for g in games_list]
    ids_mutual = reduce(lambda l, r: set(l).intersection(r), game_ids)

    return {game_id: games_list[0][game_id] for game_id in ids_mutual}
Beispiel #2
0
 def test_returns_friends_list(self):
     steam_id = '76561198020882912'
     friends = steam.SteamAPI().get_friends_ids(steam_id)
     self.assertTrue(len(friends) > 0)
Beispiel #3
0
 def test_my_persona(self):
     steam_id = '76561198020882912'
     names = steam.SteamAPI().get_player_names([steam_id])
     self.assertEqual({steam_id: 'Fractalize'}, names)
Beispiel #4
0
    def test_my_profile_id(self):
        profile_url = 'http://steamcommunity.com/id/fractalize/'
        steam_id = '76561198020882912'

        self.assertEqual(steam.SteamAPI().get_steam64_from_profile(profile_url), steam_id)
Beispiel #5
0
 def test_Ive_recently_played_games(self):
     steam_id = '76561198020882912'
     games = steam.SteamAPI().get_recent_games(steam_id)
     self.assertTrue(len(games) > 0)
Beispiel #6
0
 def test_I_own_games(self):
     steam_id = '76561198020882912'
     games = steam.SteamAPI().get_games(steam_id)
     self.assertTrue(len(games) > 0)