diff options
-rw-r--r-- | .group_test.go.swp | bin | 12288 -> 0 bytes | |||
-rw-r--r-- | .scene_test.go.swp | bin | 12288 -> 0 bytes | |||
-rw-r--r-- | bridge_test.go | 19 |
3 files changed, 13 insertions, 6 deletions
diff --git a/.group_test.go.swp b/.group_test.go.swp Binary files differdeleted file mode 100644 index fc71b1e..0000000 --- a/.group_test.go.swp +++ /dev/null diff --git a/.scene_test.go.swp b/.scene_test.go.swp Binary files differdeleted file mode 100644 index a23ba31..0000000 --- a/.scene_test.go.swp +++ /dev/null diff --git a/bridge_test.go b/bridge_test.go index 04aa0d0..a28b0ab 100644 --- a/bridge_test.go +++ b/bridge_test.go @@ -8,26 +8,33 @@ package hue import ( - "fmt" + "github.com/collinux/GoHue" "testing" ) func TestCreateUser(t *testing.T) { - bridge, _ := NewBridge("192.168.1.128") + bridges, err := hue.FindBridges() + if err != nil { + t.Fatal(err) + } + bridge := bridges[0] username, _ := bridge.CreateUser("test") bridge.Login(username) //bridge.DeleteUser(bridge.Username) } func TestFindBridges(t *testing.T) { - bridges, _ := FindBridges() - fmt.Println(bridges[0].IPAddress) + bridges, err := hue.FindBridges() + if err != nil { + t.Fatal(err) + } + t.Log(bridges) } func TestBridgeLogin(t *testing.T) { - bridges, err := FindBridges() + bridges, err := hue.FindBridges() if err != nil { - fmt.Println("Error on TestBridgeLogin") + t.Fatal(err) } bridges[0].Login("427de8bd6d49f149c8398e4fc08f") |