Test searching verified extensions only.
(self, temp_dir)
| 3128 | assert {r["id"] for r in results} == {"jira", "linear"} |
| 3129 | |
| 3130 | def test_search_verified_only(self, temp_dir): |
| 3131 | """Test searching verified extensions only.""" |
| 3132 | import yaml as yaml_module |
| 3133 | |
| 3134 | project_dir = temp_dir / "project" |
| 3135 | project_dir.mkdir() |
| 3136 | (project_dir / ".specify").mkdir() |
| 3137 | |
| 3138 | # Use a single-catalog config so community extensions don't interfere |
| 3139 | config_path = project_dir / ".specify" / "extension-catalogs.yml" |
| 3140 | with open(config_path, "w") as f: |
| 3141 | yaml_module.dump( |
| 3142 | { |
| 3143 | "catalogs": [ |
| 3144 | { |
| 3145 | "name": "test-catalog", |
| 3146 | "url": ExtensionCatalog.DEFAULT_CATALOG_URL, |
| 3147 | "priority": 1, |
| 3148 | "install_allowed": True, |
| 3149 | } |
| 3150 | ] |
| 3151 | }, |
| 3152 | f, |
| 3153 | ) |
| 3154 | |
| 3155 | catalog = ExtensionCatalog(project_dir) |
| 3156 | |
| 3157 | # Create mock catalog |
| 3158 | catalog_data = { |
| 3159 | "schema_version": "1.0", |
| 3160 | "extensions": { |
| 3161 | "jira": { |
| 3162 | "name": "Jira", |
| 3163 | "id": "jira", |
| 3164 | "version": "1.0.0", |
| 3165 | "description": "Jira", |
| 3166 | "verified": True, |
| 3167 | }, |
| 3168 | "linear": { |
| 3169 | "name": "Linear", |
| 3170 | "id": "linear", |
| 3171 | "version": "1.0.0", |
| 3172 | "description": "Linear", |
| 3173 | "verified": False, |
| 3174 | }, |
| 3175 | }, |
| 3176 | } |
| 3177 | |
| 3178 | catalog.cache_dir.mkdir(parents=True, exist_ok=True) |
| 3179 | catalog.cache_file.write_text(json.dumps(catalog_data)) |
| 3180 | catalog.cache_metadata_file.write_text( |
| 3181 | json.dumps( |
| 3182 | { |
| 3183 | "cached_at": datetime.now(timezone.utc).isoformat(), |
| 3184 | "catalog_url": "http://test.com", |
| 3185 | } |
| 3186 | ) |
| 3187 | ) |
nothing calls this directly
no test coverage detected