1
0
mirror of https://github.com/home-assistant/supervisor.git synced 2025-12-24 12:29:08 +00:00

Add timeout handling to gdbus (#2053)

* Add timeout handling to gdbus

* fix bus name

* make it silent

* fix tests

* add more wraper
This commit is contained in:
Pascal Vizeli
2020-09-14 14:22:38 +02:00
committed by GitHub
parent c9db42583b
commit ca60a69b22
2 changed files with 18 additions and 15 deletions

View File

@@ -44,7 +44,10 @@ def dbus() -> DBus:
async def mock_get_properties(_, interface):
return load_json_fixture(f"{interface.replace('.', '_')}.json")
async def mock_send(_, command):
async def mock_send(_, command, silent=False):
if silent:
return ""
filetype = "xml" if "--xml" in command else "fixture"
fixture = f"{command[6].replace('/', '_')[1:]}.{filetype}"
return load_fixture(fixture)