1
0
mirror of https://github.com/home-assistant/supervisor.git synced 2026-04-18 07:35:22 +01:00

Improve handling with nested objects (#1253)

This commit is contained in:
Pascal Vizeli
2019-08-22 14:24:50 +02:00
committed by GitHub
parent c0e3ccdb83
commit 8b9cd4f122
2 changed files with 32 additions and 6 deletions

View File

@@ -276,3 +276,27 @@ def test_systemd_unitlist_complex():
],
]
]
def test_networkmanager_dns_properties():
"""Test NetworkManager DNS properties."""
raw = "({'Mode': <'default'>, 'RcManager': <'file'>, 'Configuration': <[{'nameservers': <['192.168.23.30']>, 'domains': <['syshack.local']>, 'interface': <'eth0'>, 'priority': <100>, 'vpn': <false>}]>},)"
# parse data
data = DBus.parse_gvariant(raw)
assert data == [
{
"Mode": "default",
"RcManager": "file",
"Configuration": [
{
"nameservers": ["192.168.23.30"],
"domains": ["syshack.local"],
"interface": "eth0",
"priority": 100,
"vpn": False,
}
],
}
]