Skip to content

Commit

Permalink
Add tests for get_original_searches
Browse files Browse the repository at this point in the history
  • Loading branch information
Askaholic committed Jan 2, 2024
1 parent ecde33b commit 97d09a7
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/unit_tests/test_matchmaker_queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,12 +261,33 @@ def test_combined_search_attributes(matchmaker_players):
p2.ratings[RatingType.LADDER_1V1],
p3.ratings[RatingType.LADDER_1V1]
]
assert search.get_original_searches() == [s1, s2]
assert search.failed_matching_attempts == 1

search.register_failed_matching_attempt()
assert search.failed_matching_attempts == 2


def test_search_get_original_searches(matchmaker_players):
p1, p2, p3, p4, p5, p6 = matchmaker_players
s1 = Search([p1, p2])
s2 = Search([p3])
s3 = Search([p4, p5])
s4 = Search([p6])
cs1 = CombinedSearch(s1, s2)
cs2 = CombinedSearch(cs1, s3)
search = CombinedSearch(cs2, s4)

assert search.get_original_searches() == [cs2, s4]


def test_combined_search_nested_get_original_searches(matchmaker_players):
p1 = matchmaker_players[0]
s1 = Search([p1])

assert s1.get_original_searches() == [s1]


def test_queue_time_until_next_pop(queue_factory):
team_size = 2
t1 = PopTimer(queue_factory(team_size=team_size))
Expand Down

0 comments on commit 97d09a7

Please sign in to comment.