Skip to content

Commit

Permalink
Fix hue tests that have uncaught exceptions (home-assistant#33443)
Browse files Browse the repository at this point in the history
  • Loading branch information
azogue authored Mar 31, 2020
1 parent ffefdcf commit 977f1a6
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 12 deletions.
2 changes: 1 addition & 1 deletion tests/components/hue/test_bridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ async def test_reset_unloads_entry_if_setup(hass):

async def test_handle_unauthorized(hass):
"""Test handling an unauthorized error on update."""
entry = Mock()
entry = Mock(async_setup=Mock(return_value=mock_coro(Mock())))
entry.data = {"host": "1.2.3.4", "username": "mock-username"}
hue_bridge = bridge.HueBridge(hass, entry, False, False)

Expand Down
10 changes: 4 additions & 6 deletions tests/components/hue/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,17 +193,15 @@ async def test_security_vuln_check(hass):
entry = MockConfigEntry(domain=hue.DOMAIN, data={"host": "0.0.0.0"})
entry.add_to_hass(hass)

config = Mock(bridgeid="", mac="", modelid="BSB002", swversion="1935144020")
config.name = "Hue"

with patch.object(
hue,
"HueBridge",
Mock(
return_value=Mock(
async_setup=CoroutineMock(return_value=True),
api=Mock(
config=Mock(
bridgeid="", mac="", modelid="BSB002", swversion="1935144020"
)
),
async_setup=CoroutineMock(return_value=True), api=Mock(config=config)
)
),
):
Expand Down
4 changes: 2 additions & 2 deletions tests/components/hue/test_light.py
Original file line number Diff line number Diff line change
Expand Up @@ -893,7 +893,7 @@ async def test_group_features(hass, mock_bridge):
"modelid": "LCT001",
"swversion": "66009461",
"manufacturername": "Philips",
"uniqueid": "456",
"uniqueid": "4567",
}
light_3 = {
"state": {
Expand Down Expand Up @@ -945,7 +945,7 @@ async def test_group_features(hass, mock_bridge):
"modelid": "LCT001",
"swversion": "66009461",
"manufacturername": "Philips",
"uniqueid": "123",
"uniqueid": "1234",
}
light_response = {
"1": light_1,
Expand Down
3 changes: 0 additions & 3 deletions tests/ignore_uncaught_exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,6 @@
("tests.components.dyson.test_fan", "test_purecool_component_setup_only_once"),
("tests.components.dyson.test_sensor", "test_purecool_component_setup_only_once"),
("test_homeassistant_bridge", "test_homeassistant_bridge_fan_setup"),
("tests.components.hue.test_bridge", "test_handle_unauthorized"),
("tests.components.hue.test_init", "test_security_vuln_check"),
("tests.components.hue.test_light", "test_group_features"),
("tests.components.ios.test_init", "test_creating_entry_sets_up_sensor"),
("tests.components.ios.test_init", "test_not_configuring_ios_not_creates_entry"),
("tests.components.local_file.test_camera", "test_file_not_readable"),
Expand Down

0 comments on commit 977f1a6

Please sign in to comment.