Rework chromecast fix (#16804)
* Revert changes of #16471, and fix the platform setup issue * Fix unit test * Fix * Fix comment * Fix test * Address review comment * Address review comment
This commit is contained in:
1 parent
329d9dfc06
commit
564ad7e22a
3 files changed
+37
-13
No files matched your search
+6
-4
@@ -609,16 +609,18 @@ def patch_yaml_files(files_dict, endswith=True):
|
||||
return patch.object(yaml, 'open', mock_open_f, create=True)
|
||||
|
||||
|
||||
def mock_coro(return_value=None):
|
||||
"""Return a coro that returns a value."""
|
||||
return mock_coro_func(return_value)()
|
||||
def mock_coro(return_value=None, exception=None):
|
||||
"""Return a coro that returns a value or raise an exception."""
|
||||
return mock_coro_func(return_value, exception)()
|
||||
|
||||
|
||||
def mock_coro_func(return_value=None):
|
||||
def mock_coro_func(return_value=None, exception=None):
|
||||
"""Return a method to create a coro function that returns a value."""
|
||||
@asyncio.coroutine
|
||||
def coro(*args, **kwargs):
|
||||
"""Fake coroutine."""
|
||||
if exception:
|
||||
raise exception
|
||||
return return_value
|
||||
|
||||
return coro
|
||||
|
||||
Reference in new issue
Block a user