Files
silver_pose/v2/cmd/silver-pose/main_test.go
T

23 lines
747 B
Go
Raw Normal View History

package main
import (
"strings"
"testing"
"silverpose/v2/internal/config"
)
func TestValidateStartupRejectsMissingRuntimeWithoutLeakingSource(t *testing.T) {
err := validateStartup(config.Config{
Source: config.SourceConfig{URL: "rtsp://operator:secret@example/Streaming/Channels/101"},
Model: config.ModelConfig{ONNXPath: "missing-model.onnx", SHA256: strings.Repeat("a", 64), ONNXRuntimeDLLPath: "missing-runtime.dll"},
Tools: config.ToolConfig{FFmpegPath: "missing-ffmpeg.exe", FFprobePath: "missing-ffprobe.exe"},
})
if err == nil {
t.Fatal("expected missing runtime error")
}
if strings.Contains(err.Error(), "rtsp://") || strings.Contains(err.Error(), "secret") {
t.Fatalf("startup error leaked source: %v", err)
}
}