Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 97d09a7

Browse files
committedJan 2, 2024
Add tests for get_original_searches
1 parent ecde33b commit 97d09a7

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed
 

‎tests/unit_tests/test_matchmaker_queue.py

+21
Original file line numberDiff line numberDiff line change
@@ -261,12 +261,33 @@ def test_combined_search_attributes(matchmaker_players):
261261
p2.ratings[RatingType.LADDER_1V1],
262262
p3.ratings[RatingType.LADDER_1V1]
263263
]
264+
assert search.get_original_searches() == [s1, s2]
264265
assert search.failed_matching_attempts == 1
265266

266267
search.register_failed_matching_attempt()
267268
assert search.failed_matching_attempts == 2
268269

269270

271+
def test_search_get_original_searches(matchmaker_players):
272+
p1, p2, p3, p4, p5, p6 = matchmaker_players
273+
s1 = Search([p1, p2])
274+
s2 = Search([p3])
275+
s3 = Search([p4, p5])
276+
s4 = Search([p6])
277+
cs1 = CombinedSearch(s1, s2)
278+
cs2 = CombinedSearch(cs1, s3)
279+
search = CombinedSearch(cs2, s4)
280+
281+
assert search.get_original_searches() == [cs2, s4]
282+
283+
284+
def test_combined_search_nested_get_original_searches(matchmaker_players):
285+
p1 = matchmaker_players[0]
286+
s1 = Search([p1])
287+
288+
assert s1.get_original_searches() == [s1]
289+
290+
270291
def test_queue_time_until_next_pop(queue_factory):
271292
team_size = 2
272293
t1 = PopTimer(queue_factory(team_size=team_size))

0 commit comments

Comments
 (0)
Please sign in to comment.