Ben Baker's installed-software collection, software delivery (run_script and
update_app), agentless adoption tool and command-queue hardening, with his
authorship preserved.
Reviewed before promotion. Fixed: the endpoints plugin tests were never collected
by pytest, the SBOM snapshot table's key would exhaust on MySQL, ingest did not
truncate two columns strict MySQL would reject, and update_app's version branch
pinned a digest for a file that route never serves. Agent packaging moved off
require_role('admin') onto a new endpoints.agentpackage permission.
Contract 0.27.0. Full suite 2231, frontend 314.
31 lines
1.0 KiB
Python
31 lines
1.0 KiB
Python
"""Printedparts 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.printedparts.plugin import PrintedpartsPlugin
|
|
|
|
|
|
def test_printedparts_plugin_meta_is_valid():
|
|
"""PrintedpartsPlugin.meta returns a PluginMeta with the expected name."""
|
|
plugin = PrintedpartsPlugin()
|
|
assert plugin.meta.name == 'printedparts'
|
|
assert plugin.meta.api_prefix == '/api/printedparts'
|
|
|
|
|
|
def test_printedparts_plugin_get_blueprint_returns_blueprint():
|
|
"""get_blueprint returns a Flask Blueprint, not None."""
|
|
from flask import Blueprint
|
|
plugin = PrintedpartsPlugin()
|
|
assert isinstance(plugin.get_blueprint(), Blueprint)
|
|
|
|
|
|
def test_printedparts_plugin_get_models_returns_a_model():
|
|
"""get_models returns a list with at least one SQLAlchemy model."""
|
|
plugin = PrintedpartsPlugin()
|
|
models = plugin.get_models()
|
|
assert len(models) >= 1
|
|
for model in models:
|
|
assert hasattr(model, '__tablename__')
|