From 5a50f14c0affbfee66a795d9df5bfe6ecb905e7c Mon Sep 17 00:00:00 2001 From: Brannon Imamura Date: Mon, 19 Sep 2022 16:02:27 -0500 Subject: [PATCH 1/3] Update cli.py --- cookie_composer/cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cookie_composer/cli.py b/cookie_composer/cli.py index f1fcd43..0d08ed4 100644 --- a/cookie_composer/cli.py +++ b/cookie_composer/cli.py @@ -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) ) From c6482d46c11e70b354851a9c431634d0d4a6c51f Mon Sep 17 00:00:00 2001 From: Brannon Imamura Date: Mon, 19 Sep 2022 16:44:36 -0500 Subject: [PATCH 2/3] add very basic cli tests --- cookie_composer/cli.py | 3 +++ tests/test_cli.py | 20 ++++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 tests/test_cli.py diff --git a/cookie_composer/cli.py b/cookie_composer/cli.py index 0d08ed4..02fd1a4 100644 --- a/cookie_composer/cli.py +++ b/cookie_composer/cli.py @@ -158,3 +158,6 @@ def update(): def link(): """Link an existing project to a template or composition.""" pass + +if __name__ == '__main__': + cli() diff --git a/tests/test_cli.py b/tests/test_cli.py new file mode 100644 index 0000000..7864c63 --- /dev/null +++ b/tests/test_cli.py @@ -0,0 +1,20 @@ +from click.testing import CliRunner +import pytest + +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 From e5425d5bebb847be59b48ad5c9ac3cfb11fa5a92 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 19 Sep 2022 21:44:53 +0000 Subject: [PATCH 3/3] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- cookie_composer/cli.py | 3 ++- tests/test_cli.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cookie_composer/cli.py b/cookie_composer/cli.py index 02fd1a4..19ae92e 100644 --- a/cookie_composer/cli.py +++ b/cookie_composer/cli.py @@ -159,5 +159,6 @@ def link(): """Link an existing project to a template or composition.""" pass -if __name__ == '__main__': + +if __name__ == "__main__": cli() diff --git a/tests/test_cli.py b/tests/test_cli.py index 7864c63..f57cda0 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -1,5 +1,5 @@ -from click.testing import CliRunner import pytest +from click.testing import CliRunner from cookie_composer import cli