mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-02 23:06:30 +00:00

* Use bool for host internet * Ignore host check if no network manager * Update supervisor/host/network.py Co-authored-by: Pascal Vizeli <pvizeli@syshack.ch> * Check dbus connection isntead of supported features Co-authored-by: Pascal Vizeli <pvizeli@syshack.ch>
20 lines
701 B
Python
20 lines
701 B
Python
"""Test supported features."""
|
|
# pylint: disable=protected-access
|
|
from unittest.mock import patch
|
|
|
|
from supervisor.coresys import CoreSys
|
|
|
|
|
|
async def test_connectivity_not_connected(coresys: CoreSys):
|
|
"""Test host unknown connectivity."""
|
|
with patch("supervisor.utils.gdbus.DBus._send", return_value="[0]"):
|
|
await coresys.host.network.check_connectivity()
|
|
assert not coresys.host.network.connectivity
|
|
|
|
|
|
async def test_connectivity_connected(coresys: CoreSys):
|
|
"""Test host full connectivity."""
|
|
with patch("supervisor.utils.gdbus.DBus._send", return_value="[4]"):
|
|
await coresys.host.network.check_connectivity()
|
|
assert coresys.host.network.connectivity
|