ops: add disk capacity incident assessment
This commit is contained in:
1 parent
ca37d8a1bb
commit
afec9b11d1
2 files changed
+54
No files matched your search
@@ -0,0 +1,19 @@
|
||||
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)
|
||||
Reference in new issue
Block a user