goonvif/ge_test.go

29 lines
476 B
Go
Raw Normal View History

2024-11-07 23:26:17 +08:00
package goonvif
import (
"os"
"testing"
"git.pyer.club/kingecg/goonvif/onvif/media"
"git.pyer.club/kingecg/goxml"
)
func TestDecodeGetProfile(t *testing.T) {
type Envelope struct {
Header struct{}
Body struct {
GetProfilesResponse media.GetProfilesResponse
}
}
data, err := os.ReadFile("result.xml")
if err != nil {
t.Fatal(err)
}
e := Envelope{}
de := goxml.Unmarshal(data, &e)
if de != nil {
t.Fatal(de)
}
t.Log(e.Body.GetProfilesResponse)
}