(t *testing.T)
| 160 | } |
| 161 | |
| 162 | func 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 | |
| 195 | func TestDebugModel_Generate(t *testing.T) { |
| 196 | t.Parallel() |
nothing calls this directly
no test coverage detected