20 lines
594 B
Python
20 lines
594 B
Python
from src.disk_capacity import assess_disk_capacity, read_disk_capacity
|
|
|
|
|
|
def test_usage_at_incident_threshold_requires_action():
|
|
status = assess_disk_capacity(total_bytes=100, available_bytes=15)
|
|
|
|
assert status == {
|
|
"usage_percent": 85.0,
|
|
"threshold_percent": 85.0,
|
|
"incident": True,
|
|
}
|
|
|
|
|
|
def test_read_disk_capacity_assesses_a_real_filesystem(tmp_path):
|
|
status = read_disk_capacity(tmp_path)
|
|
|
|
assert 0 <= status["usage_percent"] <= 100
|
|
assert status["threshold_percent"] == 85.0
|
|
assert status["incident"] is (status["usage_percent"] >= 85.0)
|