Skip to content

Compress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.

Fix test_router_is_available_with_models after MLModelRegistry refactor

chopratejas0bd9ce502477
diff --git a/tests/test_image_compressor.py b/tests/test_image_compressor.py
index 8ff3ba099..7eeee1136 100644
--- a/tests/test_image_compressor.py
+++ b/tests/test_image_compressor.py
@@ -720,16 +720,11 @@ class TestTrainedRouterMocked:
assert signals.is_complex == 0.3
assert signals.has_small_details == 0.2
- @patch("headroom.image.trained_router.AutoModelForSequenceClassification")
- @patch("headroom.image.trained_router.AutoTokenizer")
- def test_router_is_available_with_models(self, mock_tokenizer, mock_model):
+ def test_router_is_available_with_models(self):
"""Router reports available when models can load."""
- mock_tokenizer.from_pretrained.return_value = MagicMock()
- mock_model.from_pretrained.return_value = MagicMock()
-
router = TrainedRouter()
- # Mock _load_models to not actually load
+ # Mock _load_models to not actually load (models loaded via MLModelRegistry now)
with patch.object(router, "_load_models"):
assert router.is_available() is True