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

Function TestChatAdvisorConfig_Update

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

Source from the content-addressed store, hash-verified

12788}
12789
12790func TestChatAdvisorConfig_Update(t *testing.T) {
12791 t.Parallel()
12792
12793 ctx := testutil.Context(t, testutil.WaitLong)
12794 adminClient := newChatClient(t)
12795 coderdtest.CreateFirstUser(t, adminClient.Client)
12796
12797 want := codersdk.AdvisorConfig{
12798 Enabled: true,
12799 MaxUsesPerRun: 5,
12800 MaxOutputTokens: 1024,
12801 }
12802
12803 err := adminClient.UpdateChatAdvisorConfig(ctx, want)
12804 require.NoError(t, err)
12805
12806 resp, err := adminClient.GetChatAdvisorConfig(ctx)
12807 require.NoError(t, err)
12808 require.Equal(t, want, resp)
12809}
12810
12811func TestChatAdvisorConfig_MemberCannotWriteButCanRead(t *testing.T) {
12812 t.Parallel()

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