<filename>tests/utils.py
import json
from time import time

from async_asgi_testclient import TestClient

from qbot.utils import calculate_signature


async def send_slack_request(event: dict, client: TestClient):
    timestamp = time()
    data = json.dumps(event).encode("utf-8")
    signature = calculate_signature(timestamp, data)
    return await client.post(
        "/",
        headers={
            "X-Slack-Request-Timestamp": str(timestamp),
            "X-Slack-Signature": signature,
        },
        data=data,
    )

<filename>tests/utils.py
import json
from time import time

from async_asgi_testclient import TestClient

from qbot.utils import calculate_signature


async def send_slack_request(event: dict, client: TestClient):
    timestamp = time()
    data = json.dumps(event).encode("utf-8")
    signature = calculate_signature(timestamp, data)
    return await client.post(
        "/",
        headers={
            "X-Slack-Request-Timestamp": str(timestamp),
            "X-Slack-Signature": signature,
        },
        data=data,
    )
