Files
OpenJarvis/tests/core/test_config_phase5.py
T
Jon Saad-FalconandClaude Opus 4.6 301e9cd2d4 Implement OpenJarvis v1.0 — all five pillars, SDK, benchmarks, Docker
Complete implementation across six development phases (v0.1 through v1.0):

- Core: Registry system, config, event bus, types (Phase 0)
- Intelligence + Inference: Model routing, Ollama/vLLM/llama.cpp/Cloud engines (Phase 1)
- Memory: SQLite/FAISS/ColBERT/BM25/Hybrid backends, document ingest, context injection (Phase 2)
- Agents: Simple/Orchestrator/Custom/OpenClaw agents, tool system (Phase 3)
- Learning: HeuristicRouter, reward functions, GRPO stub, telemetry aggregation (Phase 4)
- SDK: Jarvis class, OpenClaw protocol/transport, benchmarks, Docker deployment (Phase 5)

520 tests passing, 8 skipped (optional deps). Ruff lint clean.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 00:52:48 +00:00

54 lines
1.7 KiB
Python

"""Phase 5 foundation tests — BenchmarkRegistry and config."""
from __future__ import annotations
import pytest
from openjarvis.core.config import JarvisConfig, load_config
from openjarvis.core.registry import BenchmarkRegistry
class TestBenchmarkRegistry:
def test_register_and_get(self):
BenchmarkRegistry.register_value("test-bench", "dummy")
assert BenchmarkRegistry.get("test-bench") == "dummy"
def test_keys(self):
BenchmarkRegistry.register_value("a", 1)
BenchmarkRegistry.register_value("b", 2)
assert set(BenchmarkRegistry.keys()) == {"a", "b"}
def test_contains(self):
BenchmarkRegistry.register_value("present", True)
assert BenchmarkRegistry.contains("present")
assert not BenchmarkRegistry.contains("absent")
def test_duplicate_raises(self):
BenchmarkRegistry.register_value("dup", 1)
with pytest.raises(ValueError, match="already has an entry"):
BenchmarkRegistry.register_value("dup", 2)
class TestConfigPhase5:
def test_jarvis_config_loads(self):
cfg = JarvisConfig()
assert cfg.engine is not None
assert cfg.learning is not None
def test_benchmark_registry_importable(self):
from openjarvis.core.registry import BenchmarkRegistry
assert BenchmarkRegistry is not None
def test_registry_isolation(self):
"""BenchmarkRegistry entries don't leak into other registries."""
from openjarvis.core.registry import ModelRegistry
BenchmarkRegistry.register_value("iso-test", "bench-value")
with pytest.raises(KeyError):
ModelRegistry.get("iso-test")
def test_load_config_default(self):
cfg = load_config()
assert isinstance(cfg, JarvisConfig)