def test_game_result_ordering(self): game = Game() team_a = Team("A 0") team_b = Team("B 0") team_c = Team("c 0") team_a.score = 0 team_b.score = 3 team_c.score = 3 # Ensure team ordering follows through to team list sorting game.teams = {"A": team_a, "B": team_b, "c": team_c} assert str(game.results()) == str([team_b, team_c, team_a]) team_b.name = "d" game.teams["B"].name = "d" assert str(game.results()) == str([team_c, team_b, team_a])
def test_team_ordering(self): team_a = Team("Alpha 0") team_b = Team("Beta 0") # Same score, alphabetical ordering assert team_a < team_b team_b.name = "Active" assert not team_a < team_b # Different score means score based ordering team_b.score = 1 assert not team_a < team_b