(t *testing.T)
| 316 | } |
| 317 | |
| 318 | func TestServiceTierFromChat(t *testing.T) { |
| 319 | t.Parallel() |
| 320 | |
| 321 | tests := []struct { |
| 322 | name string |
| 323 | value *string |
| 324 | want *fantasyopenai.ServiceTier |
| 325 | }{ |
| 326 | {name: "Nil"}, |
| 327 | {name: "Empty", value: ptr(" ")}, |
| 328 | {name: "Auto", value: ptr(" auto "), want: ptr(fantasyopenai.ServiceTierAuto)}, |
| 329 | {name: "FlexCase", value: ptr(" FLEX "), want: ptr(fantasyopenai.ServiceTierFlex)}, |
| 330 | {name: "Priority", value: ptr("priority"), want: ptr(fantasyopenai.ServiceTierPriority)}, |
| 331 | {name: "DefaultUnsupported", value: ptr("default")}, |
| 332 | {name: "Invalid", value: ptr("fast")}, |
| 333 | } |
| 334 | |
| 335 | for _, tt := range tests { |
| 336 | t.Run(tt.name, func(t *testing.T) { |
| 337 | t.Parallel() |
| 338 | |
| 339 | got := chatopenai.ServiceTierFromChat(tt.value) |
| 340 | if tt.want == nil { |
| 341 | require.Nil(t, got) |
| 342 | return |
| 343 | } |
| 344 | require.NotNil(t, got) |
| 345 | require.Equal(t, *tt.want, *got) |
| 346 | }) |
| 347 | } |
| 348 | } |
| 349 | |
| 350 | func TestResponsesLogProbsFromChatConfig(t *testing.T) { |
| 351 | t.Parallel() |
nothing calls this directly
no test coverage detected