Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion plugin_creator/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from cookiecutter.main import cookiecutter

from . import PLUGIN_CREATOR_VERSION, config, devops, frontend, mixins, validators
from .helpers import info, success
from .helpers import info, success, remove_dir


def default_values() -> dict:
Expand Down Expand Up @@ -131,6 +131,10 @@ def gather_info(context: dict) -> dict:

context["ci_support"] = devops.get_devops_mode() if git_support else "None"

context["testing"] = questionary.confirm(
"Include testing support?", default=True,
).ask()

return context


Expand All @@ -152,6 +156,10 @@ def cleanup(plugin_dir: str, context: dict) -> None:
if context["git_support"]:
devops.git_init(plugin_dir)

if not context["testing"]:
src_dir = os.path.join(plugin_dir, context["package_name"])
remove_dir(src_dir, "tests")


def main():
"""Run plugin scaffolding."""
Expand Down
1 change: 1 addition & 0 deletions plugin_creator/template/cookiecutter.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"plugin_creator_url": "https://github.com/inventree/plugin_creator",
"git_support": true,
"ci_support": "github",
"testing": true,
"frontend": {
"enabled": true,
"translation": true,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
"""Run unit tests for the {{ cookiecutter.plugin_name }} plugin."""

from django.test import TestCase


class PluginTest(TestCase):
"""Tests for the {{ cookiecutter.plugin_name }} plugin."""

def test_plugin(self):
"""Test that the plugin can be loaded."""
...
Loading