champion_id = player["championId"] wait_for_request() # find other matches where they played that champion matches = watcher.get_match_history(summoner_id, region=region, chapion_ids=[champion_id]) wait_for_request() # TO DO # find matches on the relevant map if possible and add item builds to files. wait_for_request() champ_data = watcher.static_get_champion(champion_id, region=region) print "CHAMP DATA" print champ_data champion_key = champ_data["key"] json_data = get_item_build(champion_key) # save on a mac if platform.system() == 'Darwin': directory = "/Applications/League of Legends.app/Contents/LoL/Config/Champions/" + champion_key + "/Recommended/LolBuilder.json" with open(directory, 'w+') as f: json.dump(json_data, f) print "saved build" # save on windows elif platform.system() == 'Windows' or platform.system.startswith("CYGWIN_NT"): directory = "C:/Riot Games/League of Legends/Config/Champions/" + champion_key + "/Recommended/LolBuilder.json"
else: continue openedfile.close() for i in range(1, 27, 1): if testCases[i].testMethod.strip() == 'static_get_champion': #####################Sample Information of Champions to compare to. These are the integers that will be returned by ################################## #####################static_get_champion and compared to the information supplied in the test cases for that method.################################## #Aatrox ID = 266 #Anivia ID = 34 #Alistar = 12 #Amumu = 32 #Blitzcrank = 53 #Galio = 3 results = rWatcher.static_get_champion(testCases[i].testInput) print("The expected oracle is : " + testCases[i].testOutcome) print("The actual oracle is : " + results['name']) testCases[i].testResult = testCases[i].testOutcome.strip( ) == results['name'].strip( ) #check to see if the name given in the testCase matches the result from the api print(testCases[i].testResult) if testCases[i].testMethod.strip() == 'static_get_item': results = rWatcher.static_get_item(int(testCases[i].testInput)) #3001 - abyssal sceptre #3003 - archangels staff #3133 caulfields #3134 serrated dirk #3135 void staff print("The expected oracle is : " + testCases[i].testOutcome) print("The actual oracle is : " + results['name'])
for player in game["participants"]: if player["summonerId"] == summoner_id: champion_id = player["championId"] wait_for_request() # find other matches where they played that champion matches = watcher.get_match_history(summoner_id, region=region, chapion_ids=[champion_id]) wait_for_request() # TO DO # find matches on the relevant map if possible and add item builds to files. wait_for_request() champ_data = watcher.static_get_champion(champion_id, region=region) print "CHAMP DATA" print champ_data champion_key = champ_data["key"] json_data = get_item_build(champion_key) # save on a mac if platform.system() == "Darwin": directory = ( "/Applications/League of Legends.app/Contents/LoL/Config/Champions/" + champion_key + "/Recommended/LolBuilder.json" ) with open(directory, "w+") as f: json.dump(json_data, f)