All checks were successful
Deploy Development / deploy (push) Successful in 41s
Test Suite / pytest-backend (push) Successful in 43s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 13s
Test Suite / k6 /health Baseline (push) Successful in 34s
Test Suite / playwright-tests (push) Successful in 1m15s
- Added support for the new planning exercise expectation profile slug in the AI prompt runtime. - Refactored SQL parameter handling in the planning exercise retrieval process to ensure correct binding for full-text search. - Updated the planning exercise suggestion logic to incorporate LLM expectation handling, improving the accuracy of exercise recommendations. - Introduced new functions to determine when to run the LLM expectation pipeline, enhancing the decision-making process for exercise suggestions. - Incremented version to 0.8.176 and updated changelog to reflect these enhancements in planning AI capabilities.
44 lines
1.3 KiB
Python
44 lines
1.3 KiB
Python
"""Tests Planungs-Retrieval SQL-Parameter."""
|
|
from planning_exercise_retrieval import fetch_retrieval_candidate_rows
|
|
|
|
|
|
def test_fetch_retrieval_binds_query_before_visibility_params():
|
|
captured = {}
|
|
|
|
class _Cur:
|
|
def execute(self, sql, params):
|
|
captured["sql"] = sql
|
|
captured["params"] = list(params)
|
|
|
|
def fetchall(self):
|
|
return [
|
|
{
|
|
"id": 1,
|
|
"title": "Test",
|
|
"summary": "",
|
|
"primary_focus_name": None,
|
|
"ft_rank": 0.2,
|
|
}
|
|
]
|
|
|
|
fetch_retrieval_candidate_rows(
|
|
_Cur(),
|
|
vis_sql="(e.visibility = 'official' OR (e.visibility = 'private' AND e.created_by = %s))",
|
|
vis_params=[42],
|
|
query="nächste Übung planen",
|
|
exercise_kind_any=None,
|
|
target=__import__(
|
|
"planning_exercise_profiles", fromlist=["PlanningTargetProfile"]
|
|
).PlanningTargetProfile(),
|
|
progression_successor_ids=set(),
|
|
anchor_skill_ids={7},
|
|
raw_pool_limit=10,
|
|
)
|
|
|
|
params = captured["params"]
|
|
assert params[0] == "nächste Übung planen"
|
|
assert params[1] == 42
|
|
assert params[2] == "archived"
|
|
assert params[-2] == "nächste Übung planen"
|
|
assert params[-1] == 10
|