mirror of
https://github.com/cedricve/go-onvif.git
synced 2025-10-04 16:22:40 +08:00
Rename variable for testing
This commit is contained in:
@@ -6,14 +6,10 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
|
|
||||||
var defaultDevice = Device{
|
|
||||||
XAddr: "http://192.168.1.75:5000/onvif/device_service",
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestGetInformation(t *testing.T) {
|
func TestGetInformation(t *testing.T) {
|
||||||
log.Println("Test GetInformation")
|
log.Println("Test GetInformation")
|
||||||
|
|
||||||
res, err := defaultDevice.GetInformation()
|
res, err := testDevice.GetInformation()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Error(err)
|
t.Error(err)
|
||||||
}
|
}
|
||||||
@@ -25,7 +21,7 @@ func TestGetInformation(t *testing.T) {
|
|||||||
func TestGetCapabilities(t *testing.T) {
|
func TestGetCapabilities(t *testing.T) {
|
||||||
log.Println("Test GetCapabilities")
|
log.Println("Test GetCapabilities")
|
||||||
|
|
||||||
res, err := defaultDevice.GetCapabilities()
|
res, err := testDevice.GetCapabilities()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Error(err)
|
t.Error(err)
|
||||||
}
|
}
|
||||||
@@ -37,7 +33,7 @@ func TestGetCapabilities(t *testing.T) {
|
|||||||
func TestGetDiscoveryMode(t *testing.T) {
|
func TestGetDiscoveryMode(t *testing.T) {
|
||||||
log.Println("Test GetDiscoveryMode")
|
log.Println("Test GetDiscoveryMode")
|
||||||
|
|
||||||
res, err := defaultDevice.GetDiscoveryMode()
|
res, err := testDevice.GetDiscoveryMode()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Error(err)
|
t.Error(err)
|
||||||
}
|
}
|
||||||
@@ -48,7 +44,7 @@ func TestGetDiscoveryMode(t *testing.T) {
|
|||||||
func TestGetScopes(t *testing.T) {
|
func TestGetScopes(t *testing.T) {
|
||||||
log.Println("Test GetScopes")
|
log.Println("Test GetScopes")
|
||||||
|
|
||||||
res, err := defaultDevice.GetScopes()
|
res, err := testDevice.GetScopes()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Error(err)
|
t.Error(err)
|
||||||
}
|
}
|
||||||
@@ -60,7 +56,7 @@ func TestGetScopes(t *testing.T) {
|
|||||||
func TestGetHostname(t *testing.T) {
|
func TestGetHostname(t *testing.T) {
|
||||||
log.Println("Test GetHostname")
|
log.Println("Test GetHostname")
|
||||||
|
|
||||||
res, err := defaultDevice.GetHostname()
|
res, err := testDevice.GetHostname()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Error(err)
|
t.Error(err)
|
||||||
}
|
}
|
||||||
|
4
utils.go
4
utils.go
@@ -5,6 +5,10 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var testDevice = Device{
|
||||||
|
XAddr: "http://192.168.1.75:5000/onvif/device_service",
|
||||||
|
}
|
||||||
|
|
||||||
func interfaceToString(src interface{}) string {
|
func interfaceToString(src interface{}) string {
|
||||||
str, _ := src.(string)
|
str, _ := src.(string)
|
||||||
return str
|
return str
|
||||||
|
Reference in New Issue
Block a user