add support for FFA tournament
This commit is contained in:
@@ -64,4 +64,19 @@ class TournamentDomainTests(unittest.TestCase):
|
||||
self.assertEqual(sm.status, MatchStatus.WAITING)
|
||||
self.assertEqual(sm.participants[0].participant_id, self.participant_c.id)
|
||||
self.assertEqual(sm.participants[0].slot_number, 1)
|
||||
self.assertIsNone(sm.winner)
|
||||
self.assertIsNone(sm.winner)
|
||||
|
||||
def test_ffa_tournament_with_15_participants_gets_generated_correctly(self) -> None:
|
||||
tournament_under_test = generate_new_tournament("Among Us", "It's Among Us", GameTitle("Among Us", "", "", ""), TournamentFormat.FFA, self.start_time, 32, TournamentStatus.OPEN)
|
||||
|
||||
for i in range(1, 16):
|
||||
tournament_under_test.add_participant(Participant(i, ParticipantType.PLAYER))
|
||||
tournament_under_test.start()
|
||||
|
||||
# Assert Tournament was switched to ONGOING
|
||||
self.assertEqual(TournamentStatus.ONGOING, tournament_under_test.status)
|
||||
|
||||
matches_in_tournament = sorted(tournament_under_test.matches, key=lambda m: m.match_id)
|
||||
|
||||
self.assertEqual(1, len(matches_in_tournament))
|
||||
self.assertEqual(15, len(matches_in_tournament[0].participants))
|
||||
|
||||
Reference in New Issue
Block a user