Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nkgilley committed Aug 11, 2016
1 parent b8132d6 commit 2fd7760
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions tests/components/switch/test_flux.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,8 @@ def test_flux_after_sunrise_before_sunset(self):
fire_time_changed(self.hass, test_time)
self.hass.pool.block_till_done()
call = turn_on_calls[-1]
self.assertEqual(call.data[light.ATTR_BRIGHTNESS], 180)
self.assertEqual(call.data[light.ATTR_XY_COLOR], [0.431, 0.38])
self.assertEqual(call.data[light.ATTR_BRIGHTNESS], 119)
self.assertEqual(call.data[light.ATTR_XY_COLOR], [0.591, 0.395])

# pylint: disable=invalid-name
def test_flux_after_sunset_before_stop(self):
Expand Down Expand Up @@ -233,8 +233,8 @@ def test_flux_after_sunset_before_stop(self):
fire_time_changed(self.hass, test_time)
self.hass.pool.block_till_done()
call = turn_on_calls[-1]
self.assertEqual(call.data[light.ATTR_BRIGHTNESS], 153)
self.assertEqual(call.data[light.ATTR_XY_COLOR], [0.496, 0.397])
self.assertEqual(call.data[light.ATTR_BRIGHTNESS], 119)
self.assertEqual(call.data[light.ATTR_XY_COLOR], [0.591, 0.395])

# pylint: disable=invalid-name
def test_flux_after_stop_before_sunrise(self):
Expand Down Expand Up @@ -323,8 +323,8 @@ def test_flux_with_custom_start_stop_times(self):
fire_time_changed(self.hass, test_time)
self.hass.pool.block_till_done()
call = turn_on_calls[-1]
self.assertEqual(call.data[light.ATTR_BRIGHTNESS], 154)
self.assertEqual(call.data[light.ATTR_XY_COLOR], [0.494, 0.397])
self.assertEqual(call.data[light.ATTR_BRIGHTNESS], 119)
self.assertEqual(call.data[light.ATTR_XY_COLOR], [0.591, 0.395])

# pylint: disable=invalid-name
def test_flux_with_custom_colortemps(self):
Expand Down Expand Up @@ -369,8 +369,8 @@ def test_flux_with_custom_colortemps(self):
fire_time_changed(self.hass, test_time)
self.hass.pool.block_till_done()
call = turn_on_calls[-1]
self.assertEqual(call.data[light.ATTR_BRIGHTNESS], 167)
self.assertEqual(call.data[light.ATTR_XY_COLOR], [0.461, 0.389])
self.assertEqual(call.data[light.ATTR_BRIGHTNESS], 248)
self.assertEqual(call.data[light.ATTR_XY_COLOR], [0.335, 0.345])

# pylint: disable=invalid-name
def test_flux_with_custom_brightness(self):
Expand Down Expand Up @@ -415,7 +415,7 @@ def test_flux_with_custom_brightness(self):
self.hass.pool.block_till_done()
call = turn_on_calls[-1]
self.assertEqual(call.data[light.ATTR_BRIGHTNESS], 255)
self.assertEqual(call.data[light.ATTR_XY_COLOR], [0.496, 0.397])
self.assertEqual(call.data[light.ATTR_XY_COLOR], [0.591, 0.395])

def test_flux_with_multiple_lights(self):
"""Test the flux switch with multiple light entities."""
Expand Down Expand Up @@ -472,14 +472,14 @@ def test_flux_with_multiple_lights(self):
fire_time_changed(self.hass, test_time)
self.hass.pool.block_till_done()
call = turn_on_calls[-1]
self.assertEqual(call.data[light.ATTR_BRIGHTNESS], 171)
self.assertEqual(call.data[light.ATTR_XY_COLOR], [0.452, 0.386])
self.assertEqual(call.data[light.ATTR_BRIGHTNESS], 119)
self.assertEqual(call.data[light.ATTR_XY_COLOR], [0.591, 0.395])
call = turn_on_calls[-2]
self.assertEqual(call.data[light.ATTR_BRIGHTNESS], 171)
self.assertEqual(call.data[light.ATTR_XY_COLOR], [0.452, 0.386])
self.assertEqual(call.data[light.ATTR_BRIGHTNESS], 119)
self.assertEqual(call.data[light.ATTR_XY_COLOR], [0.591, 0.395])
call = turn_on_calls[-3]
self.assertEqual(call.data[light.ATTR_BRIGHTNESS], 171)
self.assertEqual(call.data[light.ATTR_XY_COLOR], [0.452, 0.386])
self.assertEqual(call.data[light.ATTR_BRIGHTNESS], 119)
self.assertEqual(call.data[light.ATTR_XY_COLOR], [0.591, 0.395])

def test_flux_with_mired(self):
"""Test the flux switch´s mode mired."""
Expand Down Expand Up @@ -521,7 +521,7 @@ def test_flux_with_mired(self):
fire_time_changed(self.hass, test_time)
self.hass.pool.block_till_done()
call = turn_on_calls[-1]
self.assertEqual(call.data[light.ATTR_COLOR_TEMP], 269)
self.assertEqual(call.data[light.ATTR_COLOR_TEMP], 526)

def test_flux_with_kelvin(self):
"""Test the flux switch´s mode kelvin."""
Expand Down Expand Up @@ -563,4 +563,4 @@ def test_flux_with_kelvin(self):
fire_time_changed(self.hass, test_time)
self.hass.pool.block_till_done()
call = turn_on_calls[-1]
self.assertEqual(call.data[light.ATTR_COLOR_TEMP], 3708)
self.assertEqual(call.data[light.ATTR_COLOR_TEMP], 1900)

0 comments on commit 2fd7760

Please sign in to comment.