mirror of
https://github.com/kerberos-io/onvif.git
synced 2026-08-23 15:08:33 +00:00
upgrade onvif library
This commit is contained in:
24
Device_test.go
Normal file
24
Device_test.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package onvif
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestDevice_SetDeviceInfoFromScopes(t *testing.T) {
|
||||
const (
|
||||
name = "DeviceName"
|
||||
hardware = "M9000"
|
||||
)
|
||||
scopes := []string{
|
||||
"onvif://www.onvif.org/Profile/Streaming",
|
||||
"onvif://www.onvif.org/SomethingElse/value",
|
||||
"onvif://www.onvif.org/name/" + name,
|
||||
"onvif://www.onvif.org/hardware/" + hardware,
|
||||
}
|
||||
device := Device{}
|
||||
device.SetDeviceInfoFromScopes(scopes)
|
||||
assert.Equal(t, device.info.Name, name)
|
||||
assert.Equal(t, device.info.Model, hardware)
|
||||
}
|
||||
Reference in New Issue
Block a user