MCPcopy Create free account
hub / github.com/Chat2AnyLLM/code-agent-manager / seedProvider

Function seedProvider

internal/cli/cli_test.go:56–72  ·  view source on GitHub ↗

seedProvider seeds a single provider into the SQLite store at storePath by running `cam provider add` via execute().

(t *testing.T, storePath, name, endpoint, client, models, apiKeyEnv string)

Source from the content-addressed store, hash-verified

54// seedProvider seeds a single provider into the SQLite store at storePath
55// by running `cam provider add` via execute().
56func seedProvider(t *testing.T, storePath, name, endpoint, client, models, apiKeyEnv string) {
57 t.Helper()
58 args := []string{"--store", storePath, "provider", "add", name, "--endpoint", endpoint}
59 if client != "" {
60 args = append(args, "--client", client)
61 }
62 if models != "" {
63 args = append(args, "--model", models)
64 }
65 if apiKeyEnv != "" {
66 args = append(args, "--api-key-env", apiKeyEnv)
67 }
68 stdout, stderr, code := execute(t, args...)
69 if code != 0 {
70 t.Fatalf("seed provider %s: exit=%d stderr=%s stdout=%s", name, code, stderr, stdout)
71 }
72}

Calls 1

executeFunction · 0.85

Tested by

no test coverage detected