Skip to content

Commit f5aaa7e

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 920b628 commit f5aaa7e

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

tests/test_presets.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1180,6 +1180,16 @@ def test_search_with_cached_data(self, project_dir, monkeypatch):
11801180
catalog = PresetCatalog(project_dir)
11811181
catalog.cache_dir.mkdir(parents=True, exist_ok=True)
11821182

1183+
# Restrict to default catalog only — prevents community catalog network calls
1184+
# which would add extra results and make the count assertions flaky.
1185+
(project_dir / ".specify" / "preset-catalogs.yml").write_text(
1186+
f"catalogs:\n"
1187+
f" - url: \"{PresetCatalog.DEFAULT_CATALOG_URL}\"\n"
1188+
f" name: default\n"
1189+
f" priority: 1\n"
1190+
f" install_allowed: true\n"
1191+
)
1192+
11831193
catalog_data = {
11841194
"schema_version": "1.0",
11851195
"presets": {

0 commit comments

Comments
 (0)