@@ -29,41 +29,23 @@ func TestCatalogProviders(t *testing.T) {
2929func TestIsCatalogProvider (t * testing.T ) {
3030 t .Parallel ()
3131
32- tests := []struct {
33- name string
34- provider string
35- want bool
36- }{
37- // Core providers
38- {"openai is core" , "openai" , true },
39- {"anthropic is core" , "anthropic" , true },
40- {"google is core" , "google" , true },
41- {"dmr is core" , "dmr" , true },
42- {"amazon-bedrock is core" , "amazon-bedrock" , true },
43-
44- // Aliases with BaseURL (should be included)
45- {"mistral has BaseURL" , "mistral" , true },
46- {"xai has BaseURL" , "xai" , true },
47- {"nebius has BaseURL" , "nebius" , true },
48- {"requesty has BaseURL" , "requesty" , true },
49- {"ollama has BaseURL" , "ollama" , true },
50- {"minimax has BaseURL" , "minimax" , true },
51-
52- // Aliases without BaseURL (should be excluded)
53- {"azure has no BaseURL" , "azure" , false },
54-
55- // Unknown providers
56- {"unknown provider" , "unknown" , false },
57- {"cohere not supported" , "cohere" , false },
32+ // All core providers should be catalog providers
33+ for _ , core := range CoreProviders {
34+ assert .True (t , IsCatalogProvider (core ), "core provider %s should be a catalog provider" , core )
5835 }
5936
60- for _ , tt := range tests {
61- t .Run (tt .name , func (t * testing.T ) {
62- t .Parallel ()
63- got := IsCatalogProvider (tt .provider )
64- assert .Equal (t , tt .want , got )
65- })
37+ // Aliases: catalog if and only if they have a BaseURL
38+ for name , alias := range Aliases {
39+ if alias .BaseURL != "" {
40+ assert .True (t , IsCatalogProvider (name ), "alias %s with BaseURL should be a catalog provider" , name )
41+ } else {
42+ assert .False (t , IsCatalogProvider (name ), "alias %s without BaseURL should NOT be a catalog provider" , name )
43+ }
6644 }
45+
46+ // Unknown providers
47+ assert .False (t , IsCatalogProvider ("unknown" ))
48+ assert .False (t , IsCatalogProvider ("cohere" ))
6749}
6850
6951func TestAllProviders (t * testing.T ) {
0 commit comments