mirror of
https://github.com/home-assistant/supervisor.git
synced 2026-05-08 08:58:31 +01:00
Finish migrating read_text to executor (#5698)
* Move read_text to executor * switch to async_capture_exception * Finish moving read_text to executor * Cover read_bytes and some write_text calls as well * Fix await issues * Fix format_message
This commit is contained in:
@@ -87,13 +87,13 @@ def test_hide_virtual_device(coresys: CoreSys):
|
||||
assert coresys.hardware.helper.hide_virtual_device(udev_device)
|
||||
|
||||
|
||||
def test_last_boot_error(coresys: CoreSys, caplog: LogCaptureFixture):
|
||||
async def test_last_boot_error(coresys: CoreSys, caplog: LogCaptureFixture):
|
||||
"""Test error reading last boot."""
|
||||
with patch(
|
||||
"supervisor.hardware.helper.Path.read_text", side_effect=(err := OSError())
|
||||
):
|
||||
err.errno = errno.EBADMSG
|
||||
assert coresys.hardware.helper.last_boot is None
|
||||
assert await coresys.hardware.helper.last_boot() is None
|
||||
|
||||
assert coresys.core.healthy is True
|
||||
assert "Can't read stat data" in caplog.text
|
||||
|
||||
Reference in New Issue
Block a user