Skip to content

PatchedMessage

faststream.rabbit.test.PatchedMessage #

Bases: IncomingMessage

Patched message class for testing purposes.

This class extends aio_pika's IncomingMessage class and is used to simulate RabbitMQ message handling during tests.

ack async #

ack(multiple: bool = False) -> None

Asynchronously acknowledge a message.

PARAMETER DESCRIPTION
multiple

Whether to acknowledge multiple messages at once. Defaults to False.

TYPE: bool DEFAULT: False

RETURNS DESCRIPTION
None

None

Note

The above docstring is autogenerated by docstring-gen library (https://docstring-gen.airt.ai)

Source code in faststream/rabbit/test.py
async def ack(self, multiple: bool = False) -> None:
    """Asynchronously acknowledge a message.

    Args:
        multiple (bool, optional): Whether to acknowledge multiple messages at once. Defaults to False.

    Returns:
        None
    !!! note

        The above docstring is autogenerated by docstring-gen library (https://docstring-gen.airt.ai)
    """
    pass

nack async #

nack(multiple: bool = False, requeue: bool = True) -> None

Nack the message.

PARAMETER DESCRIPTION
multiple

Whether to nack multiple messages. Default is False.

TYPE: bool DEFAULT: False

requeue

Whether to requeue the message. Default is True.

TYPE: bool DEFAULT: True

RETURNS DESCRIPTION
None

None

Note

The above docstring is autogenerated by docstring-gen library (https://docstring-gen.airt.ai)

Source code in faststream/rabbit/test.py
async def nack(self, multiple: bool = False, requeue: bool = True) -> None:
    """Nack the message.

    Args:
        multiple: Whether to nack multiple messages. Default is False.
        requeue: Whether to requeue the message. Default is True.

    Returns:
        None
    !!! note

        The above docstring is autogenerated by docstring-gen library (https://docstring-gen.airt.ai)
    """
    pass

reject async #

reject(requeue: bool = False) -> None

Rejects a task.

PARAMETER DESCRIPTION
requeue

Whether to requeue the task if it fails (default: False)

TYPE: bool DEFAULT: False

RETURNS DESCRIPTION
None

None

Note

The above docstring is autogenerated by docstring-gen library (https://docstring-gen.airt.ai)

Source code in faststream/rabbit/test.py
async def reject(self, requeue: bool = False) -> None:
    """Rejects a task.

    Args:
        requeue: Whether to requeue the task if it fails (default: False)

    Returns:
        None
    !!! note

        The above docstring is autogenerated by docstring-gen library (https://docstring-gen.airt.ai)
    """
    pass

Last update: 2023-11-13