def test_qpid_stat_q_docs():
    env = {
        'qpid_stat_q': qpid_stat.QpidStatQ(context_wrap(QPID_STAT_Q_DOCS)),
        'qpid_stat_u': qpid_stat.QpidStatU(context_wrap(QPID_STAT_U_DOCS)),
    }
    failed, total = doctest.testmod(qpid_stat, globs=env)
    assert failed == 0
Example #2
0
def test_qpid_stat_u():
    qpid_list = qpid_stat.QpidStatU(context_wrap(QPID_STAT_U))
    assert qpid_list.data[0].get('subscr') == '0'
    assert qpid_list.data[0].get(
        'queue') == '00d6cc19-15fc-4b7c-af3c-6a38e7bb386d:1.0'
    assert qpid_list.data[0].get(
        'conn') == 'qpid.10.20.1.10:5671-10.20.1.10:33787'
    assert qpid_list.data[0].get('procName') == 'celery'
    assert qpid_list.data[0].get('procId') == '21409'
    assert qpid_list.data[0].get('browse') == ''
    assert qpid_list.data[0].get('acked') == ''
    assert qpid_list.data[0].get('excl') == ''
    assert qpid_list.data[0].get('creditMode') == 'CREDIT'
    assert qpid_list.data[0].get('delivered') == '2'
    assert qpid_list.data[0].get('sessUnacked') == '0'
    assert qpid_list.data[1].get(
        'queue') == 'pulp.agent.c6a430bc-5ec7-42f8-99ce-f320ed0b9113'
    assert qpid_list.data[1].get(
        'conn') == 'qpid.10.20.1.10:5671-10.30.0.148:57423'
    assert qpid_list.data[1].get('acked') == 'Y'
    assert qpid_list.data[1].get('procName') == 'goferd'
    assert qpid_list.data[2].get('subscr') == '1'
    assert qpid_list.data[2].get(
        'queue') == 'prrhss001058.infra.novamedia.com:event'
    assert qpid_list.data[2].get(
        'conn') == 'qpid.10.20.1.10:5671-10.20.1.10:33848'
    assert qpid_list.data[2].get('procName') == 'Qpid Java Client'
    assert qpid_list.data[2].get('procId') == '21066'
    assert qpid_list.data[2].get('browse') == ''
    assert qpid_list.data[2].get('acked') == 'Y'
    assert qpid_list.data[2].get('excl') == 'Y'
    assert qpid_list.data[2].get('creditMode') == 'WINDOW'
    assert qpid_list.data[2].get('delivered') == '2,623'
    assert qpid_list.data[2].get('sessUnacked') == '0'
    assert qpid_list.data[3].get('delivered') == '363,228'
    assert qpid_list.data[5].get('subscr') == 'katello_event_queue'

    # test iteration
    assert [d['queue'] for d in qpid_list] == [
        '00d6cc19-15fc-4b7c-af3c-6a38e7bb386d:1.0',
        'pulp.agent.c6a430bc-5ec7-42f8-99ce-f320ed0b9113',
        'prrhss001058.infra.novamedia.com:event',
        'celeryev.4c77bd03-1cde-49eb-bdc0-b7c38f9ff93d',
        'celery',
        'katello_event_queue',
    ]