mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-05-29 14:16:28 +00:00

* Add free disk space info * Log available space on docker image install error * Add unit to log message * Add 404 check and better log message * Set default path to supervisor data path * Clean up attribute access Co-authored-by: Pascal Vizeli <pvizeli@syshack.ch> * Move free space helper to hardware * Add hardware test Co-authored-by: Pascal Vizeli <pvizeli@syshack.ch>
14 lines
333 B
Python
14 lines
333 B
Python
"""Test host info."""
|
|
from unittest.mock import patch
|
|
|
|
from supervisor.host.info import InfoCenter
|
|
|
|
|
|
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 = info.free_space
|
|
|
|
assert free == 2.0
|