예제 #1
0
 def test_win_match(self):
     team1, team2 = self._make_teams('a', 'b')
     # [(teams), (scores)]
     m = MatchResult([(team1, team2), (2, 1)])
     m.record_result()
     # {team name: points from fixture}
     self.assertDictEqual({'a': 3}, {team1.name: team1.points})
     self.assertDictEqual({'b': 0}, {team2.name: team2.points})
     self.assertEqual(m.winner.name, team1.name)
예제 #2
0
 def test_tie_match(self):
     team1, team2 = self._make_teams('a', 'b')
     m = MatchResult([(team1, team2), (0, 0)])
     m.record_result()
     self.assertDictEqual({'a': 1}, {team1.name: team1.points})
     self.assertDictEqual({'b': 1}, {team2.name: team2.points})