diff options
author | Collin Guarino <collin.guarino@gmail.com> | 2016-09-23 17:13:27 -0400 |
---|---|---|
committer | Collin Guarino <collin.guarino@gmail.com> | 2016-09-23 17:13:27 -0400 |
commit | e4d25196b8f0a2fe9ba57c61a30a752608d507d5 (patch) | |
tree | d4f41a4f1f3c2e84df756c61b477d07b91342dc0 | |
parent | 717f77eeb3be68ba8328e04f90904070df687d3d (diff) |
Fixed output of group and scene test files.
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | .group_test.go.swp | bin | 0 -> 12288 bytes | |||
-rw-r--r-- | .scene_test.go.swp | bin | 0 -> 12288 bytes | |||
-rw-r--r-- | group_test.go | 15 | ||||
-rw-r--r-- | scene_test.go | 36 |
5 files changed, 34 insertions, 18 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1377554 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.swp diff --git a/.group_test.go.swp b/.group_test.go.swp Binary files differnew file mode 100644 index 0000000..fc71b1e --- /dev/null +++ b/.group_test.go.swp diff --git a/.scene_test.go.swp b/.scene_test.go.swp Binary files differnew file mode 100644 index 0000000..a23ba31 --- /dev/null +++ b/.scene_test.go.swp diff --git a/group_test.go b/group_test.go index 58b74bc..41f612f 100644 --- a/group_test.go +++ b/group_test.go @@ -8,15 +8,20 @@ package hue import ( - "fmt" + "github.com/collinux/GoHue" "testing" ) func TestGetGroups(t *testing.T) { - bridge, _ := NewBridge("192.168.1.128") + bridges, err := hue.FindBridges() + if err != nil { + t.Fatal(err) + } + bridge := bridges[0] bridge.Login("427de8bd6d49f149c8398e4fc08f") - groups, _ := bridge.GetGroups() - for group := range groups { - fmt.Println(groups[group]) + groups, err := bridge.GetGroups() + if err != nil { + t.Fatal(err) } + t.Log(groups) } diff --git a/scene_test.go b/scene_test.go index 1eff2ac..2717e74 100644 --- a/scene_test.go +++ b/scene_test.go @@ -8,26 +8,36 @@ package hue import ( + "github.com/collinux/GoHue" "testing" - //"fmt" ) func TestGetAllScenes(t *testing.T) { - bridge, _ := NewBridge("192.168.1.128") + bridges, err := hue.FindBridges() + if err != nil { + t.Fatal(err) + } + bridge := bridges[0] bridge.Login("427de8bd6d49f149c8398e4fc08f") - scenes, _ := bridge.GetAllScenes() - // for scene := range scenes { - // fmt.Println("SCENE: ", scenes[scene]) - // } - - individual, _ := bridge.GetScene(scenes[0].ID) - _ = individual - //fmt.Println("Individual scene: ", individual) + scenes, err := bridge.GetAllScenes() + if err != nil { + t.Fatal(err) + } + _ = scenes + // t.Log(scenes) } +// TODO not functional func TestCreateScene(t *testing.T) { - bridge, _ := NewBridge("192.168.1.128") + bridges, err := hue.FindBridges() + if err != nil { + t.Fatal(err) + } + bridge := bridges[0] bridge.Login("427de8bd6d49f149c8398e4fc08f") - scene := Scene{Lights: []string{"1", "2"}} - _ = bridge.CreateScene(scene) + scene := hue.Scene{Name: "Testing", Lights: []string{"1", "2"}} + err = bridge.CreateScene(scene) + if err != nil { + t.Fatal(err) + } } |