File test/config_listwrapper.py artifact c695b3e4ba part of check-in 93aac20151


# type: test
# title: config list wrapper
# description: check if ConfigList() access works
# config:
#   { name: key, value: "test", description: "should be accessible per pmd.config.key.value" }
#   { name: alt, type: bool, value: 1 }
# version: 0.8+
# 
# Do all the settings!

import pytest
import pluginconf

@pytest.fixture
def pmd():
    return pluginconf.plugin_meta(fn=__file__)

def key_path(pmd):
    assert pmd.config.key.value == "test"
                   #  ^^^
                   #  name lookup

def path_type(pmd):
    assert pmd.config.alt.value == '1'

def nonexistent(pmd):
    with pytest.raises(KeyError) as exc:
        assert pmd.config.donothave.help