mirror of
https://github.com/cloudstack-llc/mlx-knife.git
synced 2026-07-21 10:05:26 -04:00
86f669dc82
- 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.
31 lines
837 B
Python
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"]
|