Files
gpu-rent/tests/test_ollama_pull.py
T
Leonid Pershin dc1fde9e3e Refactor LLM runtime handling and enhance CLI documentation
- Updated `resolve_llm_runtime` to prioritize live configuration over legacy notes, ensuring accurate runtime resolution.
- Enhanced `tunnel_forwards` to prefer current configuration for LLM runtime, improving tunnel setup logic.
- Improved idle-killer logic to handle stale markers and provide clearer warnings in the status output.
- Updated CLI documentation in `cli.md` to reflect changes in command behavior and runtime handling.
- Enhanced tests to validate new runtime resolution logic and ensure proper handling of configuration states.
2026-08-21 05:40:22 +03:00

28 lines
856 B
Python

"""Unit tests for remote ollama_pull matching (stdlib helpers)."""
from importlib.util import module_from_spec, spec_from_file_location
from pathlib import Path
_ROOT = Path(__file__).resolve().parents[1]
_SPEC = spec_from_file_location(
"ollama_pull_remote",
_ROOT / "src" / "gpu_rent" / "remote" / "ollama_pull.py",
)
assert _SPEC and _SPEC.loader
_mod = module_from_spec(_SPEC)
_SPEC.loader.exec_module(_mod)
already_have = _mod.already_have
def test_exact_tag_only():
have = {"qwen2.5:3b", "qwen2.5:7b"}
assert already_have(have, "qwen2.5:7b")
assert not already_have(have, "qwen2.5:14b")
assert already_have(have, "qwen2.5:3b")
def test_latest_alias():
assert already_have({"foo:latest"}, "foo")
assert already_have({"foo"}, "foo:latest")
assert not already_have({"foo:3b"}, "foo")