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

View File

@@ -96,13 +96,14 @@ def test_disque():
@pytest.mark.skipif(not os.getenv('IRON_MQ_TOKEN'),
reason="requires IronMQ credentials")
def test_ironmq():
Conf.IRON_MQ = {'host': os.getenv('IRON_MQ_HOST'),
'token': os.getenv('IRON_MQ_TOKEN'),
Conf.IRON_MQ = {'token': os.getenv('IRON_MQ_TOKEN'),
'project_id': os.getenv('IRON_MQ_PROJECT_ID')}
# check broker
broker = get_broker(list_key='djangoQ')
assert broker.ping() is True
assert broker.info() is not None
# initialize the queue
broker.enqueue('test')
# clear before we start
broker.purge_queue()
# enqueue