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

Function TestDebugModel_Disabled

coderd/x/chatd/chatdebug/model_internal_test.go:162–193  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

160}
161
162func TestDebugModel_Disabled(t *testing.T) {
163 t.Parallel()
164
165 ctrl := gomock.NewController(t)
166 db := dbmock.NewMockStore(ctrl)
167 chatID := uuid.New()
168 ownerID := uuid.New()
169
170 svc := NewService(db, testutil.Logger(t), nil)
171 respWant := &fantasy.Response{FinishReason: fantasy.FinishReasonStop}
172 inner := &chattest.FakeModel{
173 GenerateFn: func(ctx context.Context, call fantasy.Call) (*fantasy.Response, error) {
174 _, ok := StepFromContext(ctx)
175 require.False(t, ok)
176 require.Nil(t, attemptSinkFromContext(ctx))
177 return respWant, nil
178 },
179 }
180
181 model := &debugModel{
182 inner: inner,
183 svc: svc,
184 opts: RecorderOptions{
185 ChatID: chatID,
186 OwnerID: ownerID,
187 },
188 }
189
190 resp, err := model.Generate(context.Background(), fantasy.Call{})
191 require.NoError(t, err)
192 require.Same(t, respWant, resp)
193}
194
195func TestDebugModel_Generate(t *testing.T) {
196 t.Parallel()

Callers

nothing calls this directly

Calls 7

GenerateMethod · 0.95
NewMockStoreFunction · 0.92
LoggerFunction · 0.92
NewServiceFunction · 0.85
StepFromContextFunction · 0.85
attemptSinkFromContextFunction · 0.85
NewMethod · 0.65

Tested by

no test coverage detected