File test/config.py artifact e9e6dda95e part of check-in 0ea503177a


# type: test
# title: config struct
# description: probe for some fields
# config:
#   { name: id, value: 1, description: identifier }
#   { name: string, value: string, description: should be a str }
#   { name: desc, value: -, description: be descriptive here }
#   { name: select1, type: select, select: 1|2|3, description: alternatives }
#   { name: select2, type: select, select: a=1|b=2|c=3, description: key-val }
# version: 0.1
# 
# Do all the settings!

import pytest
import pluginconf

@pytest.fixture
def config():
    return pluginconf.plugin_meta(fn=__file__)["config"]

def name(config):
    assert config[0]["name"] == "id"

def string(config):
    assert config[1]["value"] == "string"
    assert config[1]["type"] == "str"

def desc(config):
    assert config[2]["description"] == "be descriptive here"

def select1(config):
    assert config[3]["select"] == { "1":"1", "2":"2", "3":"3" }

def select2(config):
    assert config[4]["select"] == { "a":"1", "b":"2", "c":"3" }