def test_handling_core_messages(hass, mock_cloud): """Test handling core messages.""" mock_cloud.logout.return_value = mock_coro() yield from iot.async_handle_cloud(hass, mock_cloud, { 'action': 'logout', 'reason': 'Logged in at two places.' }) assert len(mock_cloud.logout.mock_calls) == 1