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

Function TestChatAdvisorConfig_RoundTripZeroValues

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

Source from the content-addressed store, hash-verified

12922}
12923
12924func TestChatAdvisorConfig_RoundTripZeroValues(t *testing.T) {
12925 t.Parallel()
12926
12927 ctx := testutil.Context(t, testutil.WaitLong)
12928 adminClient := newChatClient(t)
12929 coderdtest.CreateFirstUser(t, adminClient.Client)
12930
12931 want := codersdk.AdvisorConfig{
12932 Enabled: true,
12933 MaxUsesPerRun: 0,
12934 MaxOutputTokens: 0,
12935 }
12936
12937 err := adminClient.UpdateChatAdvisorConfig(ctx, want)
12938 require.NoError(t, err)
12939
12940 resp, err := adminClient.GetChatAdvisorConfig(ctx)
12941 require.NoError(t, err)
12942 require.Equal(t, want, resp)
12943}
12944
12945// TestChatAdvisorConfig_OverwriteClearsPreviousValues pins PUT to
12946// full-replace semantics. A second write with zero-valued fields must

Callers

nothing calls this directly

Calls 6

ContextFunction · 0.92
CreateFirstUserFunction · 0.92
newChatClientFunction · 0.70
GetChatAdvisorConfigMethod · 0.65
EqualMethod · 0.45

Tested by

no test coverage detected