Improve unit test coverage (#984)
* add tests for config * add audio tests * lint * lint * lint
This commit is contained in:
@@ -100,3 +100,24 @@ func TestDefaultAnthropicConfigWithEmptyValues(t *testing.T) {
|
||||
t.Errorf("Expected BaseURL to be %v, got %v", expectedBaseURL, config.BaseURL)
|
||||
}
|
||||
}
|
||||
|
||||
func TestClientConfigString(t *testing.T) {
|
||||
// String() should always return the constant value
|
||||
conf := openai.DefaultConfig("dummy-token")
|
||||
expected := "<OpenAI API ClientConfig>"
|
||||
got := conf.String()
|
||||
if got != expected {
|
||||
t.Errorf("ClientConfig.String() = %q; want %q", got, expected)
|
||||
}
|
||||
}
|
||||
|
||||
func TestGetAzureDeploymentByModel_NoMapper(t *testing.T) {
|
||||
// On a zero-value or DefaultConfig, AzureModelMapperFunc is nil,
|
||||
// so GetAzureDeploymentByModel should just return the input model.
|
||||
conf := openai.DefaultConfig("dummy-token")
|
||||
model := "some-model"
|
||||
got := conf.GetAzureDeploymentByModel(model)
|
||||
if got != model {
|
||||
t.Errorf("GetAzureDeploymentByModel(%q) = %q; want %q", model, got, model)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user