package executor import ( "context" "os" "testing" ) // TestClassifier_Classify_Mock tests the classifier with a mocked gemini binary. func TestClassifier_Classify_Mock(t *testing.T) { // Create a temporary mock binary. mockBinary := filepathJoin(t.TempDir(), "mock-gemini") mockContent := `#!/bin/sh echo '{"response": "{\"agent_type\": \"gemini\", \"model\": \"gemini-2.5-flash-lite\", \"reason\": \"test reason\"}"}' ` if err := os.WriteFile(mockBinary, []byte(mockContent), 0755); err != nil { t.Fatal(err) } c := &Classifier{GeminiBinaryPath: mockBinary} status := SystemStatus{ ActiveTasks: map[string]int{"claude": 5, "gemini": 1}, RateLimited: map[string]bool{"claude": false, "gemini": false}, } cls, err := c.Classify(context.Background(), "Test Task", "Test Instructions", status, "gemini") if err != nil { t.Fatalf("Classify failed: %v", err) } if cls.AgentType != "gemini" { t.Errorf("expected gemini, got %s", cls.AgentType) } if cls.Model != "gemini-2.5-flash-lite" { t.Errorf("expected gemini-2.5-flash-lite, got %s", cls.Model) } } func filepathJoin(elems ...string) string { var path string for i, e := range elems { if i == 0 { path = e } else { path = path + string(os.PathSeparator) + e } } return path }