mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-12-24 12:29:08 +00:00
Use session dbus mocks for all tests (#4198)
* Use session dbus mocks for all tests * func instead of fn for pylint
This commit is contained in:
@@ -5,17 +5,20 @@ from datetime import timedelta
|
||||
from aiohttp.hdrs import USER_AGENT
|
||||
|
||||
from supervisor.coresys import CoreSys
|
||||
from supervisor.dbus.timedate import TimeDate
|
||||
from supervisor.utils.dt import utcnow
|
||||
|
||||
|
||||
async def test_timezone(run_dir, coresys: CoreSys):
|
||||
"""Test write corestate to /run/supervisor."""
|
||||
# pylint: disable=protected-access
|
||||
coresys.host.sys_dbus._timedate = TimeDate()
|
||||
# pylint: enable=protected-access
|
||||
|
||||
assert coresys.timezone == "UTC"
|
||||
assert coresys.config.timezone is None
|
||||
|
||||
await coresys.dbus.timedate.connect(coresys.dbus.bus)
|
||||
await coresys.dbus.timedate.update()
|
||||
assert coresys.timezone == "Etc/UTC"
|
||||
|
||||
coresys.config.timezone = "Europe/Zurich"
|
||||
|
||||
Reference in New Issue
Block a user