-
Notifications
You must be signed in to change notification settings - Fork 36
/
capabilities_test.go
38 lines (35 loc) · 944 Bytes
/
capabilities_test.go
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
36
37
38
package huego
import (
"testing"
)
func TestGetCapabilities(t *testing.T) {
b := New(hostname, username)
c, err := b.GetCapabilities()
if err != nil {
t.Fatal(c)
}
t.Log("Capabilities:")
t.Log(" Groups")
t.Logf(" Available: %d", c.Groups.Available)
t.Log(" Lights")
t.Logf(" Available: %d", c.Lights.Available)
t.Log(" Resourcelinks")
t.Logf(" Available: %d", c.Resourcelinks.Available)
t.Log(" Schedules")
t.Logf(" Available: %d", c.Schedules.Available)
t.Log(" Rules")
t.Logf(" Available: %d", c.Rules.Available)
t.Log(" Scenes")
t.Logf(" Available: %d", c.Scenes.Available)
t.Log(" Sensors")
t.Logf(" Available: %d", c.Sensors.Available)
t.Log(" Streaming")
t.Logf(" Available: %d", c.Streaming.Available)
}
func TestGetCapabilitiesError(t *testing.T) {
b := New(badHostname, username)
_, err := b.GetCapabilities()
if err == nil {
t.Fatal("Expected error not to be nil")
}
}