Files
EverOS/tests/unit/test_infra/test_ome/test_exceptions.py
Elliot Chen 518b8eca85 chore: initialize EverOS 1.0.0
md-first memory extraction framework for AI agents.

Markdown is the single source of truth; SQLite holds state and LanceDB
provides the rebuildable vector + BM25 + scalar index. The codebase follows
a single-direction DDD layering (entrypoints -> service -> memory -> infra,
with component / core / config cross-cutting) enforced by import-linter.

Engineering surface:
- Coding conventions in .claude/rules/ (path-scoped) and workflows in
  .claude/skills/ (/commit, /new-branch, /pr).
- GitHub Actions CI runs make lint + test + integration; pre-commit mirrors
  the gates locally (ruff, hygiene hooks, gitlint commit-msg).
- Commit messages follow Conventional Commits, enforced by gitlint.
- make lint also enforces datetime two-zone discipline and OpenAPI drift.
2026-06-06 07:33:17 +08:00

39 lines
1.0 KiB
Python

from __future__ import annotations
from everos.infra.ome.events import BaseEvent
from everos.infra.ome.exceptions import (
EmitNotDeclaredError,
OMEError,
StartupValidationError,
)
class _UnknownEvent(BaseEvent):
pass
def test_ome_error_is_base_exception() -> None:
assert issubclass(OMEError, Exception)
def test_startup_validation_error_inherits_ome_error() -> None:
assert issubclass(StartupValidationError, OMEError)
def test_emit_not_declared_error_inherits_ome_error() -> None:
assert issubclass(EmitNotDeclaredError, OMEError)
def test_emit_not_declared_carries_strategy_and_event() -> None:
ev = _UnknownEvent()
err = EmitNotDeclaredError(strategy="cluster_memcells", event=ev)
assert err.strategy == "cluster_memcells"
assert err.event is ev
assert "_UnknownEvent" in str(err)
assert "cluster_memcells" in str(err)
def test_startup_validation_carries_message() -> None:
err = StartupValidationError("missing trigger.on")
assert "missing trigger.on" in str(err)