MCPcopy Create free account
hub / github.com/diillson/chatcli / TestEmbeddingProviderLabel

Function TestEmbeddingProviderLabel

cli/hyde_setup_test.go:178–193  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

176}
177
178func TestEmbeddingProviderLabel(t *testing.T) {
179 if got := embeddingProviderLabel(nil); got != "null" {
180 t.Errorf("label(nil) = %q, want null", got)
181 }
182 if got := embeddingProviderLabel(embedding.NewNull()); got != "null" {
183 t.Errorf("label(Null) = %q, want null", got)
184 }
185 t.Setenv("CHATCLI_EMBED_PROVIDER", "bedrock")
186 p, err := embedding.NewFromEnv()
187 if err != nil {
188 t.Fatalf("NewFromEnv: %v", err)
189 }
190 if got := embeddingProviderLabel(p); !strings.HasPrefix(got, "bedrock:") {
191 t.Errorf("label = %q, want bedrock:*", got)
192 }
193}

Callers

nothing calls this directly

Calls 4

NewNullFunction · 0.92
NewFromEnvFunction · 0.92
embeddingProviderLabelFunction · 0.85
ErrorfMethod · 0.80

Tested by

no test coverage detected