29 lines
476 B
Go
29 lines
476 B
Go
|
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)
|
||
|
}
|