test: add pkg tests for gemini, openai, geminicli packages
- Add sanitize tests (internal/pkg/geminicli): 55.3% - Add constants/model tests (internal/pkg/openai): 34.2% - Add models tests (internal/pkg/gemini): 100%
This commit is contained in:
49
internal/pkg/openai/constants_test.go
Normal file
49
internal/pkg/openai/constants_test.go
Normal file
@@ -0,0 +1,49 @@
|
||||
package openai
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestDefaultModelIDs(t *testing.T) {
|
||||
ids := DefaultModelIDs()
|
||||
|
||||
// Should return same number of IDs as DefaultModels
|
||||
require.Equal(t, len(DefaultModels), len(ids))
|
||||
|
||||
// Check all expected IDs are present
|
||||
expected := []string{
|
||||
"gpt-5.4",
|
||||
"gpt-5.4-mini",
|
||||
"gpt-5.4-nano",
|
||||
"gpt-5.3-codex",
|
||||
"gpt-5.3-codex-spark",
|
||||
"gpt-5.2",
|
||||
"gpt-5.2-codex",
|
||||
"gpt-5.1-codex-max",
|
||||
"gpt-5.1-codex",
|
||||
"gpt-5.1",
|
||||
"gpt-5.1-codex-mini",
|
||||
"gpt-5",
|
||||
}
|
||||
require.Equal(t, expected, ids)
|
||||
}
|
||||
|
||||
func TestDefaultModels(t *testing.T) {
|
||||
// Verify DefaultModels is not empty
|
||||
require.NotEmpty(t, DefaultModels)
|
||||
|
||||
// Verify each model has required fields
|
||||
for _, m := range DefaultModels {
|
||||
require.NotEmpty(t, m.ID, "Model ID should not be empty")
|
||||
require.NotEmpty(t, m.DisplayName, "DisplayName should not be empty")
|
||||
require.NotEmpty(t, m.Object, "Object should not be empty")
|
||||
require.NotEmpty(t, m.OwnedBy, "OwnedBy should not be empty")
|
||||
require.NotZero(t, m.Created, "Created should not be zero")
|
||||
}
|
||||
}
|
||||
|
||||
func TestDefaultTestModel(t *testing.T) {
|
||||
require.Equal(t, "gpt-5.1-codex", DefaultTestModel)
|
||||
}
|
||||
Reference in New Issue
Block a user