Files
hermes-agent/tests/evals/test_codebase_navigability.py
teknium1 aedc6ccc3a test: purge low-value tests, lane py05 (339 removed)
Change-detectors, tautologies, source-reading tests, redundant duplicates,
mock-echo tests and dead/unrunnable tests. Per-test rationale in the lane
ledger (category + reason for every removal).
2026-09-23 03:15:26 -07:00

35 lines
1.1 KiB
Python

"""Guardrail for the navigability eval: its symbol resolver must follow the facade/sibling layout.
Two invariants the harness relies on (and that a future refactor could silently break):
1. a name imported from a facade that lives in a sibling resolves to the SIBLING (through the facade's
top-level `from sibling import name` or its PLUGIN-COMPAT lazy table);
2. a name defined in the facade itself resolves to the facade.
Both are checked against real modules on the current tree, so they also pin the layout the eval documents.
"""
from pathlib import Path
import pytest
from evals.codebase_navigability import bench
ROOT = Path(__file__).resolve().parents[2]
@pytest.fixture(scope="module")
def mods():
return bench.source_modules(ROOT)
def test_tokenizer_falls_back_without_crashing(monkeypatch):
import builtins
real_import = builtins.__import__
def no_tiktoken(name, *a, **k):
if name == "tiktoken":
raise ImportError
return real_import(name, *a, **k)
monkeypatch.setattr(builtins, "__import__", no_tiktoken)
tok = bench._tokenizer()
assert tok("abcdefgh") == 2