onvif/Device_test.go
2023-12-18 20:16:21 +01:00

25 lines
545 B
Go

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)
}