Skip to content

Commit 56c6b66

Browse files
iamaeroplaneclaude
andcommitted
fix(tests): isolate preset catalog search test from community catalog network calls
test_search_with_cached_data asserted exactly 2 results but was getting 4 because _get_merged_packs() queries the full built-in catalog stack (default + community). The community catalog had no local cache and hit the network, returning real presets. Writing a project-level preset-catalogs.yml that pins the test to the default URL only makes the count assertions deterministic. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 1198de7 commit 56c6b66

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tests/test_presets.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1175,6 +1175,16 @@ def test_search_with_cached_data(self, project_dir):
11751175
catalog = PresetCatalog(project_dir)
11761176
catalog.cache_dir.mkdir(parents=True, exist_ok=True)
11771177

1178+
# Restrict to default catalog only — prevents community catalog network calls
1179+
# which would add extra results and make the count assertions flaky.
1180+
(project_dir / ".specify" / "preset-catalogs.yml").write_text(
1181+
f"catalogs:\n"
1182+
f" - url: \"{PresetCatalog.DEFAULT_CATALOG_URL}\"\n"
1183+
f" name: default\n"
1184+
f" priority: 1\n"
1185+
f" install_allowed: true\n"
1186+
)
1187+
11781188
catalog_data = {
11791189
"schema_version": "1.0",
11801190
"presets": {

0 commit comments

Comments
 (0)