refactor: stabilize runtime and unify config

This commit is contained in:
lpf
2026-03-14 21:40:12 +08:00
parent 60eee65fec
commit 341e578c9f
75 changed files with 3081 additions and 1627 deletions

22
pkg/tools/camera_test.go Normal file
View File

@@ -0,0 +1,22 @@
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)
}
}