Initial import: shopdb-flask multi-site asset platform
Flask + Vue rewrite of the classic-ASP shopdb, built as a plugin framework so sister GE Aerospace sites can adopt it. Product version 0.7.0-pre-0.8.0, plugin contract 0.11.0, 966 backend tests. Key entry points: - docs/INSTALL-WINDOWS-IIS.md - tested Windows + IIS install runbook (own-site and subpath deployment methods) - docs/PILOT-DEPLOY.md - production pilot: stand up + import + verify - docs/IMPORT-API.md - schema-agnostic legacy data import contract - scripts/site_imports/wjf/ - West Jefferson reference import loader - docs/adr/ - twelve accepted architecture decision records
This commit is contained in:
30
shopdb/plugins/templates/tests/test_plugin.py.tmpl
Normal file
30
shopdb/plugins/templates/tests/test_plugin.py.tmpl
Normal file
@@ -0,0 +1,30 @@
|
||||
"""$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__')
|
||||
Reference in New Issue
Block a user