mirror of
https://github.com/OpenFreeEnergy/openfe.git
synced 2026-06-04 14:14:22 +08:00
* 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
26 lines
720 B
Python
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)
|
|
|