"""$Name plugin smoke tests.

Asserts the plugin loads cleanly and satisfies the framework contract.
Replace and extend with domain tests as you build the plugin out.
"""

from plugins.$name.plugin import ${Name}Plugin


def test_${name}_plugin_meta_is_valid():
    """${Name}Plugin.meta returns a PluginMeta with the expected name."""
    plugin = ${Name}Plugin()
    assert plugin.meta.name == '$name'
    assert plugin.meta.api_prefix == '/api/$name'


def test_${name}_plugin_get_blueprint_returns_blueprint():
    """get_blueprint returns a Flask Blueprint, not None."""
    from flask import Blueprint
    plugin = ${Name}Plugin()
    assert isinstance(plugin.get_blueprint(), Blueprint)


def test_${name}_plugin_get_models_returns_a_model():
    """get_models returns a list with at least one SQLAlchemy model."""
    plugin = ${Name}Plugin()
    models = plugin.get_models()
    assert len(models) >= 1
    for model in models:
        assert hasattr(model, '__tablename__')
