Continuous discovery of Sonos speakers (#23484)

This commit is contained in:
Anders Melchiorsen authored and Pascal Vizeli committed 2019-04-29 10:20:09 +02:00
1 parent 5529bcc114
commit 0ecf152153
3 files changed
+47 -30

No files matched your search

+4 -2
View File
@@ -35,8 +35,10 @@ def soco_fixture(music_library, speaker_info, dummy_soco_service):
@pytest.fixture(name="discover")
def discover_fixture(soco):
"""Create a mock pysonos discover fixture."""
with patch('pysonos.discover') as mock:
mock.return_value = {soco}
def do_callback(callback, **kwargs):
callback(soco)
with patch('pysonos.discover_thread', side_effect=do_callback) as mock:
yield mock