Skip to content

Commit

Permalink
fixed uncaught exceptions for tradfri (home-assistant#33550)
Browse files Browse the repository at this point in the history
was caused by device_info being mocks, so write to storage failed
  • Loading branch information
ziv1234 authored Apr 2, 2020
1 parent 3db9d6a commit f2dad79
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
6 changes: 5 additions & 1 deletion tests/components/tradfri/test_light.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,15 @@ def mock_light(test_features={}, test_state={}, n=0):
"""Mock a tradfri light."""
mock_light_data = Mock(**test_state)

dev_info_mock = MagicMock()
dev_info_mock.manufacturer = "manufacturer"
dev_info_mock.model_number = "model"
dev_info_mock.firmware_version = "1.2.3"
mock_light = Mock(
id=f"mock-light-id-{n}",
reachable=True,
observe=Mock(),
device_info=MagicMock(),
device_info=dev_info_mock,
)
mock_light.name = f"tradfri_light_{n}"

Expand Down
5 changes: 0 additions & 5 deletions tests/ignore_uncaught_exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,6 @@
"tests.components.tplink.test_init",
"test_configuring_devices_from_multiple_sources",
),
("tests.components.tradfri.test_light", "test_light"),
("tests.components.tradfri.test_light", "test_light_observed"),
("tests.components.tradfri.test_light", "test_light_available"),
("tests.components.tradfri.test_light", "test_turn_on"),
("tests.components.tradfri.test_light", "test_turn_off"),
("tests.components.unifi_direct.test_device_tracker", "test_get_scanner"),
("tests.components.upnp.test_init", "test_async_setup_entry_default"),
("tests.components.upnp.test_init", "test_async_setup_entry_port_mapping"),
Expand Down

0 comments on commit f2dad79

Please sign in to comment.