mirror of
https://github.com/YspCoder/clawgo.git
synced 2026-04-13 01:57:28 +08:00
23 lines
498 B
Go
23 lines
498 B
Go
package tools
|
|
|
|
import (
|
|
"context"
|
|
"strings"
|
|
"testing"
|
|
)
|
|
|
|
func TestCameraToolParsesFilenameArg(t *testing.T) {
|
|
t.Parallel()
|
|
|
|
tool := NewCameraTool(t.TempDir())
|
|
_, err := tool.Execute(context.Background(), map[string]interface{}{
|
|
"filename": "custom.jpg",
|
|
})
|
|
if err == nil {
|
|
t.Fatal("expected camera access to fail in test environment")
|
|
}
|
|
if !strings.Contains(err.Error(), "/dev/video0") && !strings.Contains(err.Error(), "camera device") {
|
|
t.Fatalf("unexpected error: %v", err)
|
|
}
|
|
}
|