How to use the aiormq.auth.PlainAuth function in aiormq

To help you get started, we’ve selected a few aiormq examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mosquito / aiormq / tests / test_connection.py View on Github external
async def test_auth_plain(amqp_connection, event_loop):
    auth = PlainAuth(amqp_connection).marshal()

    assert auth == PlainAuth(amqp_connection).marshal()

    auth_parts = auth.split(b"\x00")
    assert auth_parts == [b"", b"guest", b"guest"]

    connection = aiormq.Connection(
        amqp_connection.url.with_user("foo").with_password("bar"),
        loop=event_loop,
    )

    auth = PlainAuth(connection).marshal()

    auth_parts = auth.split(b"\x00")
    assert auth_parts == [b"", b"foo", b"bar"]

    auth = PlainAuth(connection)
    auth.value = b"boo"

    assert auth.marshal() == b"boo"
github mosquito / aiormq / tests / test_connection.py View on Github external
assert auth == PlainAuth(amqp_connection).marshal()

    auth_parts = auth.split(b"\x00")
    assert auth_parts == [b"", b"guest", b"guest"]

    connection = aiormq.Connection(
        amqp_connection.url.with_user("foo").with_password("bar"),
        loop=event_loop,
    )

    auth = PlainAuth(connection).marshal()

    auth_parts = auth.split(b"\x00")
    assert auth_parts == [b"", b"foo", b"bar"]

    auth = PlainAuth(connection)
    auth.value = b"boo"

    assert auth.marshal() == b"boo"
github mosquito / aiormq / tests / test_connection.py View on Github external
async def test_auth_plain(amqp_connection, event_loop):
    auth = PlainAuth(amqp_connection).marshal()

    assert auth == PlainAuth(amqp_connection).marshal()

    auth_parts = auth.split(b"\x00")
    assert auth_parts == [b"", b"guest", b"guest"]

    connection = aiormq.Connection(
        amqp_connection.url.with_user("foo").with_password("bar"),
        loop=event_loop,
    )

    auth = PlainAuth(connection).marshal()

    auth_parts = auth.split(b"\x00")
    assert auth_parts == [b"", b"foo", b"bar"]

    auth = PlainAuth(connection)
    auth.value = b"boo"