mirror of
https://github.com/cedricve/go-onvif.git
synced 2025-09-26 20:41:34 +08:00
67 lines
1003 B
Go
67 lines
1003 B
Go
package onvif
|
|
|
|
import (
|
|
"fmt"
|
|
"log"
|
|
"testing"
|
|
)
|
|
|
|
func TestGetInformation(t *testing.T) {
|
|
log.Println("Test GetInformation")
|
|
|
|
res, err := testDevice.GetInformation()
|
|
if err != nil {
|
|
t.Error(err)
|
|
}
|
|
|
|
js := prettyJSON(&res)
|
|
fmt.Println(js)
|
|
}
|
|
|
|
func TestGetCapabilities(t *testing.T) {
|
|
log.Println("Test GetCapabilities")
|
|
|
|
res, err := testDevice.GetCapabilities()
|
|
if err != nil {
|
|
t.Error(err)
|
|
}
|
|
|
|
js := prettyJSON(&res)
|
|
fmt.Println(js)
|
|
}
|
|
|
|
func TestGetDiscoveryMode(t *testing.T) {
|
|
log.Println("Test GetDiscoveryMode")
|
|
|
|
res, err := testDevice.GetDiscoveryMode()
|
|
if err != nil {
|
|
t.Error(err)
|
|
}
|
|
|
|
fmt.Println(res)
|
|
}
|
|
|
|
func TestGetScopes(t *testing.T) {
|
|
log.Println("Test GetScopes")
|
|
|
|
res, err := testDevice.GetScopes()
|
|
if err != nil {
|
|
t.Error(err)
|
|
}
|
|
|
|
js := prettyJSON(&res)
|
|
fmt.Println(js)
|
|
}
|
|
|
|
func TestGetHostname(t *testing.T) {
|
|
log.Println("Test GetHostname")
|
|
|
|
res, err := testDevice.GetHostname()
|
|
if err != nil {
|
|
t.Error(err)
|
|
}
|
|
|
|
js := prettyJSON(&res)
|
|
fmt.Println(js)
|
|
}
|