models on tracker
This commit is contained in:
@@ -16,12 +16,14 @@ import pytest
|
||||
|
||||
from meshnet_node.downloader import download_shard, write_shard_archive
|
||||
from meshnet_node.hardware import detect_hardware, benchmark_throughput
|
||||
from meshnet_node.cli import _resolve_model_flags
|
||||
from meshnet_node.startup import (
|
||||
_configure_torch_threads,
|
||||
_hardware_label,
|
||||
_infer_relay_url_from_tracker,
|
||||
_memory_budget,
|
||||
_probationary_status_line,
|
||||
_tracker_http_error_message,
|
||||
run_startup,
|
||||
)
|
||||
from meshnet_node.wallet import _b58encode, load_or_create_wallet
|
||||
@@ -34,6 +36,30 @@ from meshnet_tracker.server import TrackerServer
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
|
||||
def test_short_curated_model_alias_resolves_to_huggingface_repo():
|
||||
"""A known short model name must use the explicit Hugging Face path."""
|
||||
assert _resolve_model_flags("Qwen3.6-27B", None) == (
|
||||
"Qwen3.6-27B",
|
||||
"Qwen/Qwen3.6-27B",
|
||||
)
|
||||
|
||||
|
||||
def test_tracker_http_error_message_includes_rejection_body():
|
||||
"""HTTP responses are tracker rejections, not connectivity failures."""
|
||||
error = urllib.error.HTTPError(
|
||||
"https://tracker.example/v1/nodes/assign",
|
||||
404,
|
||||
"Not Found",
|
||||
{},
|
||||
io.BytesIO(b'{"error": "unknown model preset: \'missing-model\'"}'),
|
||||
)
|
||||
|
||||
assert _tracker_http_error_message(error) == (
|
||||
"Tracker rejected shard assignment (HTTP 404): "
|
||||
"unknown model preset: 'missing-model'"
|
||||
)
|
||||
|
||||
|
||||
def test_with_forced_cpu_overrides_device_but_keeps_gpu_inventory():
|
||||
"--cpu should register and run on CPU while preserving detected GPU metadata.\n\nTags: node, startup"
|
||||
import meshnet_node.hardware as hardware_mod
|
||||
|
||||
Reference in New Issue
Block a user