Files
Fabric/internal/plugins/ai/gemini/gemini_test.go
Kayvan Sylvan 4004c51b9e refactor: restructure project to align with standard Go layout
### CHANGES

- Introduce `cmd` directory for all main application binaries.
- Move all Go packages into the `internal` directory.
- Rename the `restapi` package to `server` for clarity.
- Consolidate patterns and strategies into a new `data` directory.
- Group all auxiliary scripts into a new `scripts` directory.
- Move all documentation and images into a `docs` directory.
- Update all Go import paths to reflect the new structure.
- Adjust CI/CD workflows and build commands for new layout.
2025-07-08 22:47:17 -07:00

45 lines
860 B
Go

package gemini
import (
"testing"
"github.com/google/generative-ai-go/genai"
)
// Test generated using Keploy
func TestBuildModelNameSimple(t *testing.T) {
client := &Client{}
fullModelName := "models/chat-bison-001"
expected := "chat-bison-001"
result := client.buildModelNameSimple(fullModelName)
if result != expected {
t.Errorf("Expected %v, got %v", expected, result)
}
}
// Test generated using Keploy
func TestExtractText(t *testing.T) {
client := &Client{}
response := &genai.GenerateContentResponse{
Candidates: []*genai.Candidate{
{
Content: &genai.Content{
Parts: []genai.Part{
genai.Text("Hello, "),
genai.Text("world!"),
},
},
},
},
}
expected := "Hello, world!"
result := client.extractText(response)
if result != expected {
t.Errorf("Expected %v, got %v", expected, result)
}
}