def test_goal_difference_updates_when_goals_against_change(self): team = Team(self.TEAM_NAME, self.GOALS_FOR, self.GOALS_AGAINST, self.HOME_GAMES, self.AWAY_GAMES, self.POINTS) self.assertEqual(self.GOALS_FOR - self.GOALS_AGAINST, team.goal_difference()) team.goals_against(team.goals_against() + 10) self.assertEqual((self.GOALS_FOR - self.GOALS_AGAINST) - 10, team.goal_difference())
def test_goal_difference_calculates_correctly(self): team = Team(self.TEAM_NAME, self.GOALS_FOR, self.GOALS_AGAINST, self.HOME_GAMES, self.AWAY_GAMES, self.POINTS) self.assertEqual(self.GOALS_FOR - self.GOALS_AGAINST, team.goal_difference())