Compare commits

...

1 Commits

Author SHA1 Message Date
9958943871 fix: Update quality-order test (#138)
All checks were successful
Smoke Test / smoke (pull_request) Successful in 15s
2026-04-20 23:20:27 +00:00

View File

@@ -20,9 +20,16 @@ from evolution.quant_selector import (
class TestQuantLevels:
def test_levels_ordered_by_quality(self):
"""Levels should be ordered from best quality to most aggressive."""
for i in range(len(QUANT_LEVELS) - 1):
assert QUANT_LEVELS[i].bits_per_channel > QUANT_LEVELS[i + 1].bits_per_channel
"""Levels should be ordered from best quality to most aggressive compression."""
# TurboQuant levels (turbo4, turbo3, turbo2) should have strictly ascending compression_ratio
# q4_0 is a fallback and is placed last
turbo_levels = [l for l in QUANT_LEVELS if l.name.startswith("turbo")]
for i in range(len(turbo_levels) - 1):
assert turbo_levels[i].compression_ratio < turbo_levels[i + 1].compression_ratio, \
f"{turbo_levels[i].name} ({turbo_levels[i].compression_ratio}x) should compress less than {turbo_levels[i+1].name} ({turbo_levels[i+1].compression_ratio}x)"
# q4_0 should be last (fallback position)
assert QUANT_LEVELS[-1].name == "q4_0", "q4_0 should be last as fallback"
def test_all_levels_have_required_fields(self):
for level in QUANT_LEVELS: