def test_league_free_agents(self): league = League(411647, 2019) free_agents = league.free_agents() self.assertNotEqual(len(free_agents), 0)
#vars# playersDic = {} statsDic = {} minsList = [] xAxis = [1, 2, 3] slope = 0 count = 0 # Intializing myLeague : your league_id: int, your year: int, your espn_s2=None, your swid=None # mainLeague = League('league_id', 'year', 'espn_s2', 'swid') listOfTeamsPlaying = mainLeague.standings() agents = mainLeague.free_agents(size=200) # Function for Fantasy Points (Last 15 Days) # def myPoints(player): points = 0 points += player.__getattribute__('stats')['032021']['avg']['FGM'] * 2 points -= player.__getattribute__('stats')['032021']['avg']['FGM'] - \ player.__getattribute__('stats')['032021']['avg']['FGA'] points += player.__getattribute__('stats')['032021']['avg']['FTM'] points -= player.__getattribute__('stats')['032021']['avg']['FTA'] - \ player.__getattribute__('stats')['032021']['avg']['FTM'] points += player.__getattribute__('stats')['032021']['avg']['3PTM'] points += player.__getattribute__('stats')['032021']['avg']['OREB'] + \ player.__getattribute__('stats')['032021']['avg']['DREB'] points += player.__getattribute__('stats')['032021']['avg']['AST'] * 2