Artifact c695b3e4ba0a7dcb6788f0149c4c5094130f59b67de3be3a6210d7fbf9ff2693:


# 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