mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-04-27 22:57:15 +00:00

* Refactor to dbus-next proxy interfaces * Fix tests mocking dbus methods * Fix call dbus
20 lines
622 B
Python
20 lines
622 B
Python
"""Check dbus-next implementation."""
|
|
from dbus_next.signature import Variant
|
|
|
|
from supervisor.utils.dbus import DBus
|
|
|
|
|
|
def test_remove_dbus_signature():
|
|
"""Check D-Bus signature clean-up."""
|
|
test = DBus.remove_dbus_signature(Variant("s", "Value"))
|
|
assert isinstance(test, str)
|
|
assert test == "Value"
|
|
|
|
test_dict = DBus.remove_dbus_signature({"Key": Variant("s", "Value")})
|
|
assert isinstance(test_dict["Key"], str)
|
|
assert test_dict["Key"] == "Value"
|
|
|
|
test_dict = DBus.remove_dbus_signature([Variant("s", "Value")])
|
|
assert isinstance(test_dict[0], str)
|
|
assert test_dict[0] == "Value"
|