Test searching by query text.
(self, temp_dir)
| 2993 | assert len(results) == 2 |
| 2994 | |
| 2995 | def test_search_by_query(self, temp_dir): |
| 2996 | """Test searching by query text.""" |
| 2997 | import yaml as yaml_module |
| 2998 | |
| 2999 | project_dir = temp_dir / "project" |
| 3000 | project_dir.mkdir() |
| 3001 | (project_dir / ".specify").mkdir() |
| 3002 | |
| 3003 | # Use a single-catalog config so community extensions don't interfere |
| 3004 | config_path = project_dir / ".specify" / "extension-catalogs.yml" |
| 3005 | with open(config_path, "w") as f: |
| 3006 | yaml_module.dump( |
| 3007 | { |
| 3008 | "catalogs": [ |
| 3009 | { |
| 3010 | "name": "test-catalog", |
| 3011 | "url": ExtensionCatalog.DEFAULT_CATALOG_URL, |
| 3012 | "priority": 1, |
| 3013 | "install_allowed": True, |
| 3014 | } |
| 3015 | ] |
| 3016 | }, |
| 3017 | f, |
| 3018 | ) |
| 3019 | |
| 3020 | catalog = ExtensionCatalog(project_dir) |
| 3021 | |
| 3022 | # Create mock catalog |
| 3023 | catalog_data = { |
| 3024 | "schema_version": "1.0", |
| 3025 | "extensions": { |
| 3026 | "jira": { |
| 3027 | "name": "Jira Integration", |
| 3028 | "id": "jira", |
| 3029 | "version": "1.0.0", |
| 3030 | "description": "Jira issue tracking", |
| 3031 | "tags": ["jira"], |
| 3032 | }, |
| 3033 | "linear": { |
| 3034 | "name": "Linear Integration", |
| 3035 | "id": "linear", |
| 3036 | "version": "1.0.0", |
| 3037 | "description": "Linear project management", |
| 3038 | "tags": ["linear"], |
| 3039 | }, |
| 3040 | }, |
| 3041 | } |
| 3042 | |
| 3043 | catalog.cache_dir.mkdir(parents=True, exist_ok=True) |
| 3044 | catalog.cache_file.write_text(json.dumps(catalog_data)) |
| 3045 | catalog.cache_metadata_file.write_text( |
| 3046 | json.dumps( |
| 3047 | { |
| 3048 | "cached_at": datetime.now(timezone.utc).isoformat(), |
| 3049 | "catalog_url": "http://test.com", |
| 3050 | } |
| 3051 | ) |
| 3052 | ) |
nothing calls this directly
no test coverage detected