Example #1
0
def test_rabbitmq_clear_queues(rabbitmq, rabbitmq_proc):
    """
    Declare queue, and clear it by clear_rabbitmq.
    """
    from rabbitpy import Queue
    channel = rabbitmq.channel()
    assert channel.state == channel.OPEN

    # list queues
    no_queues = rabbitmq_proc.list_queues()
    assert not no_queues

    # declare queue, and get new output
    queue = Queue(channel, 'fastlane')
    queue.declare()
    queues = rabbitmq_proc.list_queues()
    assert len(queues) > 0

    # make sure it's different and clear it
    assert queues != no_queues
    clear_rabbitmq(rabbitmq_proc, rabbitmq)

    # list_queues again and make sure it's empty
    cleared_queues = rabbitmq_proc.list_queues()
    assert no_queues == cleared_queues
Example #2
0
def test_rabbitmq_clear_queues(rabbitmq, rabbitmq_proc):
    """
    Declare queue, and clear it by clear_rabbitmq.
    """
    from rabbitpy import Queue
    channel = rabbitmq.channel()
    assert channel.state == channel.OPEN

    # list queues
    no_queues = rabbitmq_proc.list_queues()
    assert not no_queues

    # declare queue, and get new output
    queue = Queue(channel, 'fastlane')
    queue.declare()
    queues = rabbitmq_proc.list_queues()
    assert len(queues) > 0

    # make sure it's different and clear it
    assert queues != no_queues
    clear_rabbitmq(rabbitmq_proc, rabbitmq)

    # list_queues again and make sure it's empty
    cleared_queues = rabbitmq_proc.list_queues()
    assert no_queues == cleared_queues
Example #3
0
def test_rabbitmq_clear_exchanges(rabbitmq, rabbitmq_proc):
    """
    Declare exchange, and clear it by clear_rabbitmq.
    """
    from rabbitpy import Exchange
    channel = rabbitmq.channel()
    assert channel.state == channel.OPEN

    # list exchanges
    no_exchanges = rabbitmq_proc.list_exchanges()

    # declare exchange and list exchanges afterwards
    exchange = Exchange(channel, 'cache-in')
    exchange.declare()
    exchanges = rabbitmq_proc.list_exchanges()

    # make sure it differs
    assert exchanges != no_exchanges
    clear_rabbitmq(rabbitmq_proc, rabbitmq)

    # list_exchanges again and make sure it's empty
    cleared_exchanges = rabbitmq_proc.list_exchanges()
    assert no_exchanges == cleared_exchanges
Example #4
0
def test_rabbitmq_clear_exchanges(rabbitmq, rabbitmq_proc):
    """
    Declare exchange, and clear it by clear_rabbitmq.
    """
    from rabbitpy import Exchange
    channel = rabbitmq.channel()
    assert channel.state == channel.OPEN

    # list exchanges
    no_exchanges = rabbitmq_proc.list_exchanges()

    # declare exchange and list exchanges afterwards
    exchange = Exchange(channel, 'cache-in')
    exchange.declare()
    exchanges = rabbitmq_proc.list_exchanges()

    # make sure it differs
    assert exchanges != no_exchanges
    clear_rabbitmq(rabbitmq_proc, rabbitmq)

    # list_exchanges again and make sure it's empty
    cleared_exchanges = rabbitmq_proc.list_exchanges()
    assert no_exchanges == cleared_exchanges