Skip to content

Commit

Permalink
Rename variable for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
RadhiFadlillah committed May 22, 2017
1 parent 41874e9 commit 34d27b7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
14 changes: 5 additions & 9 deletions device_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,10 @@ import (
"testing"
)

var defaultDevice = Device{
XAddr: "http://192.168.1.75:5000/onvif/device_service",
}

func TestGetInformation(t *testing.T) {
log.Println("Test GetInformation")

res, err := defaultDevice.GetInformation()
res, err := testDevice.GetInformation()
if err != nil {
t.Error(err)
}
Expand All @@ -25,7 +21,7 @@ func TestGetInformation(t *testing.T) {
func TestGetCapabilities(t *testing.T) {
log.Println("Test GetCapabilities")

res, err := defaultDevice.GetCapabilities()
res, err := testDevice.GetCapabilities()
if err != nil {
t.Error(err)
}
Expand All @@ -37,7 +33,7 @@ func TestGetCapabilities(t *testing.T) {
func TestGetDiscoveryMode(t *testing.T) {
log.Println("Test GetDiscoveryMode")

res, err := defaultDevice.GetDiscoveryMode()
res, err := testDevice.GetDiscoveryMode()
if err != nil {
t.Error(err)
}
Expand All @@ -48,7 +44,7 @@ func TestGetDiscoveryMode(t *testing.T) {
func TestGetScopes(t *testing.T) {
log.Println("Test GetScopes")

res, err := defaultDevice.GetScopes()
res, err := testDevice.GetScopes()
if err != nil {
t.Error(err)
}
Expand All @@ -60,7 +56,7 @@ func TestGetScopes(t *testing.T) {
func TestGetHostname(t *testing.T) {
log.Println("Test GetHostname")

res, err := defaultDevice.GetHostname()
res, err := testDevice.GetHostname()
if err != nil {
t.Error(err)
}
Expand Down
4 changes: 4 additions & 0 deletions utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ import (
"strings"
)

var testDevice = Device{
XAddr: "http://192.168.1.75:5000/onvif/device_service",
}

func interfaceToString(src interface{}) string {
str, _ := src.(string)
return str
Expand Down

0 comments on commit 34d27b7

Please sign in to comment.