From 0b48413834389d48e4ce42b1d79157c5ca825ff5 Mon Sep 17 00:00:00 2001 From: Collin Guarino Date: Fri, 23 Sep 2016 17:48:20 -0400 Subject: Added error checking in light_test --- light_test.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/light_test.go b/light_test.go index 9b4486e..57235e1 100644 --- a/light_test.go +++ b/light_test.go @@ -20,9 +20,15 @@ func TestSetLightState(t *testing.T) { } bridge := bridges[0] bridge.Login("427de8bd6d49f149c8398e4fc08f") - nameTest, _ := bridge.GetLightByName("Desk Light") // Also tests GetAllLights + nameTest, err := bridge.GetLightByName("Desk Light") // Also tests GetAllLights + if err != nil { + t.Fatal(err) + } _ = nameTest - selectedLight, _ := bridge.GetLightByIndex(7) + selectedLight, err := bridge.GetLightByIndex(7) + if err != nil { + t.Fatal(err) + } selectedLight.On() selectedLight.SetBrightness(100) -- cgit v1.2.3