1
0
mirror of https://github.com/home-assistant/supervisor.git synced 2025-12-20 18:38:59 +00:00

Exclude already-existing layers from pull progress calculation

Layers that already exist locally should not count towards download
progress since there's nothing to download for them. Only layers that
need pulling are included in the progress calculation.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Stefan Agner
2025-12-01 18:24:35 +01:00
parent 91f1f548e5
commit 24377b51df
5 changed files with 39 additions and 35 deletions

View File

@@ -591,11 +591,9 @@ class TestImagePullProgress:
)
)
# Count-based: 2 layers total, each = 50%
# cached: 100% (already exists)
# Only 1 layer needs pulling (cached layer excluded)
# pulled: 35% (50% of 70% download weight)
# Total: (100 + 35) / 2 = 67.5%
assert progress.calculate_progress() == pytest.approx(67.5)
assert progress.calculate_progress() == pytest.approx(35.0)
# Complete the pulled layer
progress.process_event(