Skip to content

Commit 5115610

Browse files
committed
test: merge test_problem_finder.py files
1 parent 58f3f82 commit 5115610

File tree

2 files changed

+25
-25
lines changed

2 files changed

+25
-25
lines changed

tests/cli/test_problem_finder.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import pytest
22

33
from leetcode_py.cli.utils.problem_finder import (
4+
_build_problem_tags_cache,
45
find_problem_by_number,
56
find_problems_by_tag,
67
get_all_problems,
@@ -104,3 +105,27 @@ def test_problem_finder_consistency():
104105
grind_problems = find_problems_by_tag("grind-75")
105106
for problem in grind_problems:
106107
assert problem in all_problems
108+
109+
110+
def test_build_problem_tags_cache_with_real_tags():
111+
result = _build_problem_tags_cache()
112+
113+
# Test that grind tag includes both grind-75 problems and daily_temperatures
114+
assert "daily_temperatures" in result
115+
assert "grind" in result["daily_temperatures"]
116+
117+
# Test that grind-75 problems also get grind tag
118+
assert "two_sum" in result
119+
assert "grind-75" in result["two_sum"]
120+
assert "grind" in result["two_sum"]
121+
122+
123+
def test_get_tags_for_problem_extended():
124+
# Test daily_temperatures has grind tag
125+
tags = get_tags_for_problem("daily_temperatures")
126+
assert "grind" in tags
127+
128+
# Test grind-75 problem has both tags
129+
tags = get_tags_for_problem("two_sum")
130+
assert "grind-75" in tags
131+
assert "grind" in tags

tests/test_problem_finder.py

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)