refactor(realestate-matcher): integer tier points + clearer legacy path docstring

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-28 08:38:09 +09:00
parent a75ff069df
commit eb04b954a5
2 changed files with 30 additions and 6 deletions

View File

@@ -81,3 +81,27 @@ def test_eligibility_score_two_types_returns_20():
def test_eligibility_score_caps_at_25():
from app.matcher import _eligibility_score
assert _eligibility_score(["a", "b", "c", "d", "e"]) == 25
def test_region_score_b_tier_district():
"""광역 매칭 + B티어 자치구: 10 + 15 = 25."""
from app.matcher import _region_score
profile = {
"preferred_regions": ["서울"],
"preferred_districts": {"S": [], "A": [], "B": ["관악구"], "C": [], "D": []},
}
ann = {"region_name": "서울특별시", "district": "관악구"}
score, _ = _region_score(profile, ann)
assert score == 25
def test_region_score_c_tier_district():
"""광역 매칭 + C티어 자치구: 10 + 10 = 20."""
from app.matcher import _region_score
profile = {
"preferred_regions": ["서울"],
"preferred_districts": {"S": [], "A": [], "B": [], "C": ["은평구"], "D": []},
}
ann = {"region_name": "서울특별시", "district": "은평구"}
score, _ = _region_score(profile, ann)
assert score == 20