MCPcopy Create free account
hub / github.com/coder/coder / TestHasPreviousResponseID

Function TestHasPreviousResponseID

coderd/x/chatd/chatopenai/responses_test.go:257–298  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

255}
256
257func TestHasPreviousResponseID(t *testing.T) {
258 t.Parallel()
259
260 emptyID := ""
261 responseID := "resp-123"
262
263 tests := []struct {
264 name string
265 opts fantasy.ProviderOptions
266 want bool
267 }{
268 {
269 name: "NilOptions",
270 },
271 {
272 name: "EmptyID",
273 opts: fantasy.ProviderOptions{
274 fantasyopenai.Name: &fantasyopenai.ResponsesProviderOptions{
275 PreviousResponseID: &emptyID,
276 },
277 },
278 },
279 {
280 name: "NonEmptyID",
281 opts: fantasy.ProviderOptions{
282 fantasyopenai.Name: &fantasyopenai.ResponsesProviderOptions{
283 PreviousResponseID: &responseID,
284 },
285 },
286 want: true,
287 },
288 }
289
290 for _, tt := range tests {
291 t.Run(tt.name, func(t *testing.T) {
292 t.Parallel()
293
294 got := chatopenai.HasPreviousResponseID(tt.opts)
295 require.Equal(t, tt.want, got)
296 })
297 }
298}
299
300func TestClearPreviousResponseID(t *testing.T) {
301 t.Parallel()

Callers

nothing calls this directly

Calls 3

HasPreviousResponseIDFunction · 0.92
RunMethod · 0.65
EqualMethod · 0.45

Tested by

no test coverage detected