Skip to content

Commit

Permalink
Merge pull request #12 from bnimam/fx-cli-broken
Browse files Browse the repository at this point in the history
Fix CLI
  • Loading branch information
coordt authored Sep 20, 2022
2 parents 310ab0e + e5425d5 commit 7be5f03
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cookie_composer/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def create(
is_flag=True,
help="Do not load a config file. Use the defaults instead",
)
@click.argument("path_or_url", type=str, required=True, help="The template or composition path or URL")
@click.argument("path_or_url", type=str, required=True)
@click.argument(
"destination", required=False, type=click.Path(exists=True, file_okay=False, writable=True, path_type=Path)
)
Expand Down Expand Up @@ -158,3 +158,7 @@ def update():
def link():
"""Link an existing project to a template or composition."""
pass


if __name__ == "__main__":
cli()
20 changes: 20 additions & 0 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import pytest
from click.testing import CliRunner

from cookie_composer import cli


@pytest.fixture(scope="module")
def runner():
return CliRunner()


def test_helps(runner):
result = runner.invoke(cli.create, "--help")
assert result.exit_code == 0
result = runner.invoke(cli.add, "--help")
assert result.exit_code == 0
result = runner.invoke(cli.update, "--help")
assert result.exit_code == 0
result = runner.invoke(cli.link, "--help")
assert result.exit_code == 0

0 comments on commit 7be5f03

Please sign in to comment.