Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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"
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"
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"