oclaw/tests/test_oclaw_gmail_watcher_gates.py
oliver 420abac9f1 refactor: root-package imports (svc/runtime/interfaces) and fix PYTHONPATH
- Rename platform/ to svc/ to avoid shadowing stdlib platform.
- Replace from oclaw.* with from svc/runtime/interfaces; update -m CLI paths.
- tests/conftest: prepend repo root to sys.path (no parent-folder package name).
- CI: paths and offline_eval script under repo root.
- Ops scripts: PYTHONPATH must be repo root for python -m runtime.* (fixes gateway/WhatsApp sidecar startup).
- Fix default oclaw.json path in tabular/file attachment limits; stabilize attachment test config.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-13 14:51:17 +08:00

18 lines
732 B
Python

from __future__ import annotations
from runtime.hooks.gmail_watcher import start_gmail_watcher
def test_start_gmail_watcher_top_level_hooks_disabled() -> None:
r = start_gmail_watcher({"hooks": {"enabled": False, "internal": {"enabled": True}}})
assert r.started is False and r.reason == "hooks not enabled"
def test_start_gmail_watcher_internal_disabled() -> None:
r = start_gmail_watcher({"hooks": {"internal": {"enabled": False}}})
assert r.started is False and r.reason == "hooks not enabled"
def test_start_gmail_watcher_no_account() -> None:
r = start_gmail_watcher({"hooks": {"internal": {"enabled": True}, "gmail": {}}})
assert r.started is False and r.reason == "no gmail account configured"