29 lines
984 B
Python
29 lines
984 B
Python
"""Record caller-supplied sample evidence for a non-production delivery test."""
|
|||
|
|
from __future__ import annotations
|
||
|
|
|
||
|
|
import os
|
||
|
|
from pathlib import Path
|
||
|
|
from scheduling_core.ledger import Ledger
|
||
|
|
|
||
|
|
|
||
|
|
def main() -> int:
|
||
|
|
database = os.environ.get("SCHEDULING_TEST_DATABASE", "")
|
||
|
|
message_id = os.environ.get("SCHEDULING_TEST_MESSAGE_ID", "")
|
||
|
|
recipient = os.environ.get("SCHEDULING_TEST_RECIPIENT", "")
|
||
|
|
if not all((database, message_id, recipient)):
|
||
|
|
print("FAIL isolated database, sample message ID, and recipient are required")
|
||
|
|
return 1
|
||
|
|
Ledger(Path(database)).record_supervised_test_evidence(
|
||
|
|
"authorized-supervised-postmark-confirmation-delivery-v1",
|
||
|
|
{
|
||
|
|
"provider_message_id": message_id,
|
||
|
|
"recipient": recipient,
|
||
|
|
"confirmation": "caller-confirmed-test-only",
|
||
|
|
},
|
||
|
|
)
|
||
|
|
print("recorded_nonproduction_supervised_evidence")
|
||
|
|
return 0
|
||
|
|
|
||
|
|
|
||
|
|
if __name__ == "__main__":
|
||
|
|
raise SystemExit(main())
|