mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-10-27 05:27:59 -04:00
Snapshot current maintainer-preview application changes and regression fixtures for integration into lab. Excludes local runtime data, evaluation outputs and source backups. Focused Python regression selection: 140 passed; full suite not certified.
38 lines
1.2 KiB
Python
38 lines
1.2 KiB
Python
import pytest
|
|
|
|
from src.clean_agent_preview import draft_contact_evidence_error
|
|
|
|
|
|
def check(args, observations=(), **kwargs):
|
|
return draft_contact_evidence_error('mcp__email__draft_email', args,
|
|
dependencies=('contacts',), executions=observations, **kwargs)
|
|
|
|
|
|
def contact(**overrides):
|
|
return dict(tool='resolve_contact', execution_attempted=True, error=False,
|
|
blocked=False, output='Jonathan Amos <[email protected]>', **overrides)
|
|
|
|
|
|
def test_lookup_cannot_be_skipped():
|
|
assert check({'to': '[email protected]'})
|
|
|
|
|
|
def test_guessed_address_rejected_after_lookup():
|
|
assert check({'to': '[email protected]'}, [contact()])
|
|
|
|
|
|
def test_returned_address_and_explicit_cc_are_allowed():
|
|
assert check({'to': 'Jonathan <[email protected]>', 'cc': '[email protected]'},
|
|
[contact()], user_text='CC [email protected]') is None
|
|
|
|
|
|
@pytest.mark.parametrize('field', ['error', 'blocked'])
|
|
def test_failed_lookup_does_not_ground_recipient(field):
|
|
observation = contact()
|
|
observation[field] = True
|
|
assert check({'to': '[email protected]'}, [observation])
|
|
|
|
|
|
def test_unrelated_drafts_are_not_forced_to_lookup():
|
|
assert draft_contact_evidence_error('draft_email', {'to': '[email protected]'}) is None
|