SurfSense/surfsense_backend/tests/unit/automations
CREDO23 353755fd73 test(automations): cross-cutting registries, enums, side-effects + shared fixtures
Top-level tests that span multiple submodules:

- test_stores.py (7): the trigger + action registry contracts — register
  round-trip, unknown type → None (not raise), duplicate registration
  rejected, defensive snapshot from all_*.
- test_definition_types.py (2): params_schema property on both
  ActionDefinition and TriggerDefinition reflects the Pydantic model.
- test_persistence_enums.py (3): exact string values + member sets of
  AutomationStatus / RunStatus / TriggerType — the postgres-mirrored
  contract that breaks stored rows if drifted.
- test_import_registrations.py (2): the bundled agent_task action and
  schedule trigger self-register on package import (canary for the
  side-effect import chain).

conftest.py adds isolated_action_registry / isolated_trigger_registry
fixtures: snapshot + restore of the module-level _REGISTRY dicts so
tests that add their own definitions don't leak across the suite.

14 tests, pure unit.
2026-05-28 19:03:55 +02:00
..
actions test(automations/actions): lock agent_task helpers (auto_decide + finalize) 2026-05-28 19:03:29 +02:00
dispatch test(automations/dispatch): lock _validate_inputs + DispatchError 2026-05-28 19:03:00 +02:00
runtime test(automations/runtime): lock execute_step + with_retries 2026-05-28 19:03:08 +02:00
schemas test(automations/schemas): lock definition + api validation gates 2026-05-28 19:03:42 +02:00
templating test(automations/templating): lock render, filters, environment, context 2026-05-28 19:03:22 +02:00
triggers test(automations/triggers): lock schedule cron + params 2026-05-28 19:02:52 +02:00
__init__.py test(automations): cross-cutting registries, enums, side-effects + shared fixtures 2026-05-28 19:03:55 +02:00
conftest.py test(automations): cross-cutting registries, enums, side-effects + shared fixtures 2026-05-28 19:03:55 +02:00
test_definition_types.py test(automations): cross-cutting registries, enums, side-effects + shared fixtures 2026-05-28 19:03:55 +02:00
test_import_registrations.py test(automations): cross-cutting registries, enums, side-effects + shared fixtures 2026-05-28 19:03:55 +02:00
test_persistence_enums.py test(automations): cross-cutting registries, enums, side-effects + shared fixtures 2026-05-28 19:03:55 +02:00
test_stores.py test(automations): cross-cutting registries, enums, side-effects + shared fixtures 2026-05-28 19:03:55 +02:00