File test/basic.py artifact 1fde260c36 part of check-in 8b8e58b0e7


# type: test
# title: basic PMD
# description: check for some fields
# version: 0.1-rc1
# 
# This the doc.


import pytest
import pluginconf

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

def type_from_dict(pmd):
    assert pmd["type"] == "test"

def version_as_prop(pmd):
    assert pmd.version == "0.1-rc1"

def title_text(pmd):
    assert pmd.title == "basic PMD"

def doc_field(pmd):
    assert pmd["doc"] == "This the doc."

# Should probably migrate all to PluginMeta.property access
def test_all_as_props(pmd):
    for key, val in pmd.items():
        assert getattr(pmd, key) == val