def test_doc():
    INFO = TRACKING_VALID
    STATUS = VOL_STATUS_GOOD
    env = {
            "parser_result_v_info": GlusterVolInfo(context_wrap(INFO)),
            "parser_result_v_status": GlusterVolStatus(context_wrap(STATUS))
    }
    failed, total = doctest.testmod(gluster_vol, globs=env)
    assert failed == 0
def test_gluster_volume_options():
    parser_result = GlusterVolInfo(context_wrap(TRACKING_VALID))
    assert parser_result is not None

    data = parser_result.data["test_vol"]
    assert data['network.remote-dio'] == 'enable'
    assert data['cluster.choose-local'] == 'off'
    assert data['performance.client-io-threads'] == 'off'
    assert data['performance.quick-read'] == 'off'
    assert data['performance.low-prio-threads'] == '32'
    assert data['performance.io-cache'] == 'off'
    assert data['performance.read-ahead'] == 'off'
    assert data['nfs.disable'] == 'on'
def test_invalid():
    with pytest.raises(ParseException) as e:
        GlusterVolInfo(context_wrap(TRACKING_INVALID))
    assert "Unable to parse gluster volume options: []" in str(e)