Commit Graph

2 Commits

Author SHA1 Message Date
brent.edwards 2ce29092f5 docs(my-actor.yaml): add an example actor (#3)
CI / security (push) Successful in 33s
CI / unit_tests (push) Successful in 42s
CI / coverage (push) Successful in 46s
CI / typecheck (push) Successful in 1m1s
CI / lint (push) Successful in 1m1s
CI / dead_code (push) Successful in 1m5s
CI / build (push) Successful in 27s
This code adds documentation of a sample actor.

ISSUES CLOSED: #1

Reviewed-on: #3
Reviewed-by: Luis Mendes <luis.mendes@cleverthis.com>
2026-05-20 17:56:54 +00:00
freemo 6915498ff8 test: add Behave smoke covering compile, validate, template
Three scenarios verifying the library compiles, validates, and renders
without depending on cleveragents-core:

  1. Compile a minimal two-node graph actor — parses a v3 actor dict
     through ActorConfigSchema.model_validate, compiles via
     compile_actor, asserts the metadata lists both node ids.

  2. Reject an actor missing a required field — drops 'provider' from
     a known-good actor, asserts Pydantic raises a ValidationError.

  3. Render a simple template — passes '{greeting}, {name}!' through
     SecureTemplateRenderer with greeting='Hello', name='actor';
     asserts the rendered result is 'Hello, actor!'.

`features/environment.py` is intentionally empty — the library has
no DB, no HTTP, no fixtures to set up.

Verified green: `behave features/` → 1 feature passed, 3 scenarios
passed, 11 steps passed.

Notable subtlety: Behave's Context object reserves `config` as an
internal attribute, so the step files use `actor_config` to avoid
KeyError('config') on overwrite.
2026-05-17 00:25:50 +00:00