File tree Expand file tree Collapse file tree 2 files changed +25
-25
lines changed Expand file tree Collapse file tree 2 files changed +25
-25
lines changed Original file line number Diff line number Diff line change 1
1
import pytest
2
2
3
3
from leetcode_py .cli .utils .problem_finder import (
4
+ _build_problem_tags_cache ,
4
5
find_problem_by_number ,
5
6
find_problems_by_tag ,
6
7
get_all_problems ,
@@ -104,3 +105,27 @@ def test_problem_finder_consistency():
104
105
grind_problems = find_problems_by_tag ("grind-75" )
105
106
for problem in grind_problems :
106
107
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
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments