mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-04-22 20:27:16 +00:00

* Move read_text to executor * Fix issues found by coderabbit * formated to formatted * switch to async_capture_exception * Find and replace got one too many * Update patch mock to async_capture_exception * Drop Sentry capture from format_message The error handling got introduced in #2052, however, #2100 essentially makes sure there will never be a byte object passed to this function. And even if, the Sentry aiohttp plug-in will properly catch such an exception. --------- Co-authored-by: Stefan Agner <stefan@agner.ch>
15 lines
346 B
Python
15 lines
346 B
Python
"""Test host info."""
|
|
|
|
from unittest.mock import patch
|
|
|
|
from supervisor.host.info import InfoCenter
|
|
|
|
|
|
async def test_host_free_space(coresys):
|
|
"""Test host free space."""
|
|
info = InfoCenter(coresys)
|
|
with patch("shutil.disk_usage", return_value=(42, 42, 2 * (1024.0**3))):
|
|
free = await info.free_space()
|
|
|
|
assert free == 2.0
|