Files
mlx-knife/tests_2.0/test_cli_run_wrapper.py
The BROKE Cluster Team 86f669dc82 Release 2.0.4-beta.1: Vision + Pipes + Memory
- Vision Support (Issue #45): CLI + Server with OpenAI-compatible image API, EXIF metadata
- Unix Pipes (ADR-014): stdin support, isatty detection, SIGPIPE handling
- Memory-Aware Loading (ADR-016): Pre-load checks with >70% RAM warnings
- Python 3.9-3.14: Full compatibility verified (476-485 tests passing)
- Fixed: --log-json regression (Issue #44), Vision multimodal history filtering

See CHANGELOG.md for complete details.
2025-12-16 19:35:30 +01:00

31 lines
837 B
Python

"""Tests for the mlx-run wrapper entry point."""
import sys
import pytest
from mlxk2.tools.run import main as mlx_run_main
def test_mlx_run_inserts_run_subcommand(monkeypatch):
"""Ensure mlx-run prepends 'run' so CLI parses correctly."""
captured = {}
def fake_cli_main():
captured["argv"] = sys.argv[:]
raise SystemExit(0)
monkeypatch.setattr("mlxk2.tools.run.mlxk_main", fake_cli_main)
original_argv = sys.argv[:]
sys.argv = ["mlx-run", "test-model", "prompt here"]
try:
with pytest.raises(SystemExit) as excinfo:
mlx_run_main()
assert excinfo.value.code == 0
finally:
sys.argv = original_argv
assert captured["argv"][0] == "mlx-run"
assert captured["argv"][1] == "run"
assert captured["argv"][2:] == ["test-model", "prompt here"]