Files
openfe/openfecli/tests/test_plugins.py
David W.H. Swenson ea64274813 CLI Skeleton (#49)
* Initial skeleton for the CLI

Currently requires the OPS CLI to be installed as well; next steps:

1. Add parameter core classes to infrastructure
2. Fully separate infrastructure into its own package

* switch to using plugcli

* tests for CLI

* helps if you add the tests...

* pep8 and deps cleanup

* add test_plugins
2022-02-16 11:46:15 +00:00

26 lines
720 B
Python

import click
from openfecli.plugins import OFECommandPlugin
@click.command("fake")
def fake():
pass # -no-cov- a fake placeholder click subcommand
class TestOFECommandPlugin:
def setup(self):
self.plugin = OFECommandPlugin(
command=fake,
section="Some Section",
requires_ofe=(0, 0, 1)
)
def test_plugin_setup(self):
assert self.plugin.command is fake
assert isinstance(self.plugin.command, click.Command)
assert self.plugin.section == "Some Section"
assert self.plugin.requires_lib == self.plugin.requires_cli
assert self.plugin.requires_lib == (0, 0, 1)
assert self.plugin.requires_cli == (0, 0, 1)