meal-order-manager/tests/test_terraform_email_report.py
Adam Moussa 3e9a1c60bf
feat(api): serve meals on ECS Fargate instead of Lambda
Keep the Flask app always-on with in-process jobs so CloudFront no longer fronts a cold-start API Gateway.
2026-09-21 14:37:48 -04:00

38 lines
1.2 KiB
Python

"""email_report and the Lambda/API Gateway surface stay gone (PLAT-135 / PLAT-215)."""
from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
TERRAFORM = ROOT / "terraform"
def test_email_report_handler_removed():
assert not (ROOT / "functions" / "email_report").exists()
assert not (ROOT / "functions").exists()
def test_lambda_and_api_gateway_packaging_removed():
for name in (
"lambda.tf",
"apigateway.tf",
"events.tf",
"artifacts.tf",
"build_packages.sh",
"build_packages_external.sh",
):
assert not (TERRAFORM / name).exists()
assert not (ROOT / "template.yaml").exists()
def test_email_report_not_in_remaining_config():
locals_tf = (TERRAFORM / "locals.tf").read_text()
iam_tf = (TERRAFORM / "iam.tf").read_text()
alarms = (TERRAFORM / "alarms.tf").read_text()
outputs = (TERRAFORM / "outputs.tf").read_text()
variables = (TERRAFORM / "variables.tf").read_text()
assert '"email_report"' not in locals_tf
assert "ses:SendRawEmail" not in iam_tf
assert "email-report" not in alarms
assert "email_report" not in outputs
assert "payroll_email" not in variables
assert "sender_email" not in variables