def test_get_wins(self): matches = Match.from_json('src/tests/lec_test_matches.json') lec = LEC.from_matches(matches) rge_wins = lec.teams['RGE'].get_wins() g2_wins = lec.teams['G2'].get_wins() s04_wins = lec.teams['S04'].get_wins() self.assertEqual(rge_wins, 11) self.assertEqual(g2_wins, 8) self.assertEqual(s04_wins, 5)
def __init__(self, League: League): matches = Match.from_json(League.matches_file) self.finished_matches = [] self.upcomming_matches = [] self.cumulated_outcomes = {} self.League = League for match in matches: if match.result: self.finished_matches.append(match) else: self.upcomming_matches.append(match)
def test_create_table_season(self): matches = Match.from_json('src/tests/lec_test_matches.json') lec = LEC.from_matches(matches) lec.create_table() self.assertEqual(lec.table['RGE'], 11) self.assertEqual(lec.table['MAD'], 11) self.assertEqual(lec.table['XL'], 7) self.assertEqual(lec.table['VIT'], 6) self.assertEqual(lec.table['S04'], 5) self.assertEqual(lec.table['OG'], 6) self.assertEqual(lec.table['FNC'], 7) self.assertEqual(lec.table['SK'], 8) self.assertEqual(lec.table['G2'], 8) self.assertEqual(lec.table['MSF'], 6)
def test_create_standings_season(self): matches = Match.from_json('src/tests/lec_test_matches.json') lec = LEC.from_matches(matches) lec.create_standings() self.assertIn('XL', lec.standings[6]) self.assertIn('VIT', lec.standings[7]) self.assertIn('S04', lec.standings[10]) self.assertIn('RGE', lec.standings[2]) self.assertIn('MAD', lec.standings[1]) self.assertIn('SK', lec.standings[3]) self.assertIn('OG', lec.standings[9]) self.assertIn('G2', lec.standings[4]) self.assertIn('MSF', lec.standings[8]) self.assertIn('FNC', lec.standings[5])