fixes iron-mq test

purging a queue that never had a message in it raises a not found error. So we queue one message to initialize.
This commit is contained in:
Ilan Steemers
2015-09-08 15:19:40 +02:00
parent d849774c86
commit 7fb12fce49
+3 -2
View File
@@ -96,13 +96,14 @@ def test_disque():
@pytest.mark.skipif(not os.getenv('IRON_MQ_TOKEN'), @pytest.mark.skipif(not os.getenv('IRON_MQ_TOKEN'),
reason="requires IronMQ credentials") reason="requires IronMQ credentials")
def test_ironmq(): def test_ironmq():
Conf.IRON_MQ = {'host': os.getenv('IRON_MQ_HOST'), Conf.IRON_MQ = {'token': os.getenv('IRON_MQ_TOKEN'),
'token': os.getenv('IRON_MQ_TOKEN'),
'project_id': os.getenv('IRON_MQ_PROJECT_ID')} 'project_id': os.getenv('IRON_MQ_PROJECT_ID')}
# check broker # check broker
broker = get_broker(list_key='djangoQ') broker = get_broker(list_key='djangoQ')
assert broker.ping() is True assert broker.ping() is True
assert broker.info() is not None assert broker.info() is not None
# initialize the queue
broker.enqueue('test')
# clear before we start # clear before we start
broker.purge_queue() broker.purge_queue()
# enqueue # enqueue