Files
onvif/ptz/types_test.go
Cédric Verstraeten fe86ea942d Return errors for failed SOAP responses
Propagate HTTP 4xx/5xx errors from SOAP and digest requests, preserve responses, and ensure PTZ zero coordinates are serialized. Add regression tests for both behaviors.
2026-08-05 13:13:42 +02:00

26 lines
540 B
Go

package ptz
import (
"encoding/xml"
"strings"
"testing"
"github.com/kerberos-io/onvif/xsd/onvif"
)
func TestContinuousMoveIncludesZeroPanTiltCoordinates(t *testing.T) {
request := ContinuousMove{
Velocity: onvif.PTZSpeedPanTilt{
PanTilt: onvif.Vector2D{X: 0.5, Y: 0},
},
}
encoded, err := xml.Marshal(request)
if err != nil {
t.Fatalf("xml.Marshal() error = %v", err)
}
if !strings.Contains(string(encoded), `x="0.5" y="0"`) {
t.Fatalf("ContinuousMove PanTilt = %s, want explicit x and y attributes", encoded)
}
}