Python/Flask, intentionally outdated dependencies (flask 2.0.1, requests 2.25.1, urllib3 1.26.4) for SCA demo. CWE-89, CWE-327, CWE-798, CWE-22 in legacy_billing.py.
22 lines
513 B
Python
22 lines
513 B
Python
from app import app
|
|
|
|
|
|
def test_health():
|
|
client = app.test_client()
|
|
res = client.get("/health")
|
|
assert res.status_code == 200
|
|
assert res.get_json()["status"] == "healthy"
|
|
|
|
|
|
def test_get_payment():
|
|
client = app.test_client()
|
|
res = client.get("/api/payments/7")
|
|
assert res.status_code == 200
|
|
assert res.get_json()["id"] == 7
|
|
|
|
|
|
def test_create_payment_requires_amount():
|
|
client = app.test_client()
|
|
res = client.post("/api/payments", json={})
|
|
assert res.status_code == 400
|