mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-08-11 22:05:29 +00:00
Some checks failed
CI / Focused test guidance (report-only) (push) Has been cancelled
CI / Python syntax (compileall) (push) Has been cancelled
CI / JS syntax (node --check) (push) Has been cancelled
CI / Python tests (pytest) (push) Has been cancelled
CodeQL / Analyze (actions) (push) Has been cancelled
CodeQL / Analyze (javascript-typescript) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
Container scan / hadolint (Dockerfile lint) (push) Has been cancelled
Container scan (Trivy) / Trivy (image scan, advisory) (push) Has been cancelled
Container scan (Trivy) / Trivy (image scan + SARIF upload) (push) Has been cancelled
Dependency review / dependency-review (PR gate) (push) Has been cancelled
Dependency review / pip-audit (advisory) (push) Has been cancelled
ci / docker publish / build (amd64) (push) Has been cancelled
ci / docker publish / build (arm64) (push) Has been cancelled
Secret scan / gitleaks (push) Has been cancelled
Workflow security / actionlint (push) Has been cancelled
Workflow security / zizmor (Actions SAST) (push) Has been cancelled
ci / docker publish / merge manifest + tag (push) Has been cancelled
14 lines
752 B
Python
14 lines
752 B
Python
from services.hwfit import image_models
|
|
|
|
rank_image_models = image_models.rank_image_models
|
|
IMAGE_MODEL_REGISTRY = image_models.IMAGE_MODEL_REGISTRY
|
|
|
|
|
|
def test_rank_image_models_handles_non_dict_system(monkeypatch):
|
|
monkeypatch.setattr(image_models, "_fetch_hf_image_collection_models", lambda: [])
|
|
monkeypatch.setattr(image_models, "_discover_quant_repos", lambda *a, **k: {})
|
|
# `system` is the detected-hardware dict; if detection failed and returned
|
|
# None (or a non-dict), system.get(...) raised AttributeError. Treat a
|
|
# non-dict system as "unknown hardware" (no GPU) rather than crashing.
|
|
assert len(rank_image_models(None)) == len(IMAGE_MODEL_REGISTRY)
|
|
assert len(rank_image_models(123)) == len(IMAGE_MODEL_REGISTRY)
|