forked from cartsnitch/cartsnitch
ade03fdd1c
Add Pydantic model_validator to ReceiptWitnessSettings that fails fast if session_encryption_key is missing or a placeholder value. Conditional validation for resend_api_key when notifications_enabled=true. Co-Authored-By: Paperclip <noreply@paperclip.ing>
34 lines
893 B
Python
34 lines
893 B
Python
"""Shared test fixtures."""
|
|
|
|
import json
|
|
import os
|
|
from pathlib import Path
|
|
|
|
import pytest
|
|
|
|
FIXTURES_DIR = Path(__file__).parent / "fixtures"
|
|
|
|
os.environ.setdefault("RW_SESSION_ENCRYPTION_KEY", "test-secret-key-for-unit-tests-only-32bytes!")
|
|
os.environ.setdefault("RW_MAILGUN_WEBHOOK_SIGNING_KEY", "test-mailgun-signing-key")
|
|
|
|
|
|
@pytest.fixture
|
|
def meijer_receipt_data() -> dict:
|
|
"""Load the sample Meijer receipt fixture."""
|
|
with open(FIXTURES_DIR / "meijer_receipt.json") as f:
|
|
return json.load(f)
|
|
|
|
|
|
@pytest.fixture
|
|
def kroger_receipt_data() -> dict:
|
|
"""Load the sample Kroger receipt fixture."""
|
|
with open(FIXTURES_DIR / "kroger_receipt.json") as f:
|
|
return json.load(f)
|
|
|
|
|
|
@pytest.fixture
|
|
def target_receipt_data() -> dict:
|
|
"""Load the sample Target receipt fixture."""
|
|
with open(FIXTURES_DIR / "target_receipt.json") as f:
|
|
return json.load(f)
|