mirror of
https://github.com/hansjone/oclaw.git
synced 2026-10-09 03:30:48 +08:00
- Rename platform/ to svc/ to avoid shadowing stdlib platform. - Replace from oclaw.* with from svc/runtime/interfaces; update -m CLI paths. - tests/conftest: prepend repo root to sys.path (no parent-folder package name). - CI: paths and offline_eval script under repo root. - Ops scripts: PYTHONPATH must be repo root for python -m runtime.* (fixes gateway/WhatsApp sidecar startup). - Fix default oclaw.json path in tabular/file attachment limits; stabilize attachment test config. Co-authored-by: Cursor <cursoragent@cursor.com>
35 lines
1.2 KiB
Python
35 lines
1.2 KiB
Python
from __future__ import annotations
|
|
|
|
from runtime import skills_market
|
|
|
|
|
|
def test_get_market_adapter_clawhub_default() -> None:
|
|
a = skills_market.get_market_adapter("clawhub")
|
|
assert a.provider == "clawhub"
|
|
|
|
|
|
def test_get_market_adapter_cocoloop() -> None:
|
|
a = skills_market.get_market_adapter("cocoloop")
|
|
assert a.provider == "cocoloop"
|
|
|
|
|
|
def test_get_market_adapter_cocoloop_alias() -> None:
|
|
a = skills_market.get_market_adapter("cocoloop-cn")
|
|
assert a.provider == "cocoloop"
|
|
|
|
|
|
def test_cocoloop_resolve_archive_url(monkeypatch) -> None:
|
|
def _fake_detail(slug: str) -> dict: # noqa: ANN001
|
|
return {
|
|
"source": "cocoloop",
|
|
"slug": slug,
|
|
"latestVersion": "1.0.0",
|
|
"archiveUrl": "https://dl.example/bss/skills/demo.zip",
|
|
"versions": [{"version": "1.0.0", "archiveUrl": "https://dl.example/bss/skills/demo.zip"}],
|
|
}
|
|
|
|
monkeypatch.setattr("runtime.skills_market.cocoloop_get_skill_detail", _fake_detail)
|
|
a = skills_market.CocoloopMarketAdapter()
|
|
url, ver = a.resolve_archive_url(slug="demo", version=None)
|
|
assert url.endswith("demo.zip")
|
|
assert ver == "1.0.0"
|