Skip to content

Commit c17f522

Browse files
test: pick autocomplete choice title from kwargs for ANSI-safe lookup
Colored category badges make hard-coded titles fail under CI color settings. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent bd34c7d commit c17f522

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

packages/create-awesome-python-app/tests/test_interactive.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,14 @@ def test_interactive_template_autocomplete_omits_pointer(
3838
json.dumps({"name": "fastapi-starter"}),
3939
encoding="utf-8",
4040
)
41+
template_url = f"file://{template_dir}"
4142
catalog = {
4243
"categories": [{"slug": "backend-applications", "name": "Backend"}],
4344
"templates": [
4445
{
4546
"slug": "fastapi-starter",
4647
"name": "FastAPI Starter",
47-
"url": f"file://{template_dir}",
48+
"url": template_url,
4849
"type": "fastapi-backend",
4950
"category": "backend-applications",
5051
}
@@ -61,7 +62,9 @@ def test_interactive_template_autocomplete_omits_pointer(
6162

6263
def fake_autocomplete(*_args, **kwargs):
6364
captured_kwargs.update(kwargs)
64-
return FakePrompt("Backend FastAPI Starter (fastapi-starter)")
65+
choices = kwargs.get("choices") or []
66+
# Return a mapped title so choice_by_title resolves to the template URL.
67+
return FakePrompt(choices[0] if choices else template_url)
6568

6669
def fake_checkbox(*_args, **_kwargs):
6770
return FakePrompt([])

0 commit comments

Comments
 (0)