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:
@@ -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,
|
||||
}
|
||||
],
|
||||
}
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user