MCPcopy Index your code
hub / github.com/coder/coder / TestChatProviderAPIKeysFromDeploymentValues

Function TestChatProviderAPIKeysFromDeploymentValues

coderd/exp_chats_test.go:2930–2951  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

2928}
2929
2930func TestChatProviderAPIKeysFromDeploymentValues(t *testing.T) {
2931 t.Parallel()
2932
2933 t.Run("DoesNotReuseBridgeConfig", func(t *testing.T) {
2934 t.Parallel()
2935
2936 values := chatDeploymentValues(t)
2937 values.AI.BridgeConfig.LegacyOpenAI.Key = serpent.String("deployment-openai-key")
2938 values.AI.BridgeConfig.LegacyAnthropic.Key = serpent.String("deployment-anthropic-key")
2939 values.AI.BridgeConfig.LegacyOpenAI.BaseURL = serpent.String("https://custom-openai.example.com")
2940
2941 keys := coderd.ChatProviderAPIKeysFromDeploymentValues(values)
2942 require.Equal(t, chatprovider.ProviderAPIKeys{}, keys)
2943 })
2944
2945 t.Run("NilDeploymentValues", func(t *testing.T) {
2946 t.Parallel()
2947
2948 keys := coderd.ChatProviderAPIKeysFromDeploymentValues(nil)
2949 require.Equal(t, chatprovider.ProviderAPIKeys{}, keys)
2950 })
2951}
2952
2953func TestUserChatProviderConfigs(t *testing.T) {
2954 t.Parallel()

Callers

nothing calls this directly

Calls 5

chatDeploymentValuesFunction · 0.85
RunMethod · 0.65
StringMethod · 0.45
EqualMethod · 0.45

Tested by

no test coverage detected