forked from goastro/indiclient
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdevices_test.go
More file actions
35 lines (30 loc) · 745 Bytes
/
devices_test.go
File metadata and controls
35 lines (30 loc) · 745 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package indiclient
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func Test_Groups(t *testing.T) {
device := Device{
Name: "TestDevice",
TextProperties: map[string]TextProperty{
"Prop1": {Group: "Group A"},
},
SwitchProperties: map[string]SwitchProperty{
"Prop1": {Group: "Group A"},
},
NumberProperties: map[string]NumberProperty{
"Prop1": {Group: "Group A"},
},
LightProperties: map[string]LightProperty{
"Prop1": {Group: "Group B"},
},
BlobProperties: map[string]BlobProperty{
"Prop1": {Group: "Group B"},
},
}
groups := device.Groups()
expected := []string{"Group A", "Group B"}
require.NotNil(t, groups)
assert.Equal(t, expected, groups)
}