import pytest
from app.tests.conftest import headers
@pytest.mark.asyncio
async def test_psp_connection_and_health(client):
    assert (await client.get("/api/v1/psp-connections",headers=headers())).status_code==403
    await client.post("/api/v1/tenant-bundles",headers=headers(),json={"bundle_code":"payment.byo_psp.basic","is_active":True})
    p=(await client.post("/api/v1/psp-connections",headers=headers(),json={"provider_code":"mock","name":"Mock"})).json()
    assert (await client.post(f"/api/v1/psp-connections/{p['id']}/test",headers=headers())).json()["status"]=="healthy"
