From 8721478a30413d215e670f6459f64f94ee35724b Mon Sep 17 00:00:00 2001 From: Dan Shernicoff Date: Sat, 6 Sep 2025 17:40:19 -0400 Subject: [PATCH 1/3] Fix broken tests --- src/render_engine_cli/utils.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/render_engine_cli/utils.py b/src/render_engine_cli/utils.py index fd66420..f9f04ad 100644 --- a/src/render_engine_cli/utils.py +++ b/src/render_engine_cli/utils.py @@ -216,6 +216,8 @@ def get_editor(ctx: click.Context, param: click.Option, value: str) -> str | Non def handle_content_file(ctx: click.Context, param: click.Option, value: str) -> str | None: """Handle the content file""" + if not value: + return None if value == "stdin": content = list() click.secho('Please enter the content. To finish, put a "." on a blank line.', fg="green") From 9c6fd4d2799ddc50a907aaa008d15985aaa8af82 Mon Sep 17 00:00:00 2001 From: Dan Shernicoff Date: Sat, 6 Sep 2025 17:44:04 -0400 Subject: [PATCH 2/3] Fix workflow for tests. --- .github/workflows/test.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e4090cc..4e010a3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -5,15 +5,10 @@ on: push: branches: - main - paths: - - ".github/workflows/test.yml" - - "src/re_plugin_pack/**" - - "tests/**" - - "pyproject.toml" pull_request: paths: - ".github/workflows/test.yml" - - "src/re_plugin_pack/**" + - "src/**" - "tests/**" - "pyproject.toml" jobs: From 3805cc5603c5ac4bf5bfbc2cc9f0d2048b9f30b9 Mon Sep 17 00:00:00 2001 From: Dan Shernicoff Date: Mon, 8 Sep 2025 16:02:54 -0400 Subject: [PATCH 3/3] Check for `None`. Make sure the path is not a directory. --- src/render_engine_cli/utils.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/render_engine_cli/utils.py b/src/render_engine_cli/utils.py index f9f04ad..dde8414 100644 --- a/src/render_engine_cli/utils.py +++ b/src/render_engine_cli/utils.py @@ -216,8 +216,8 @@ def get_editor(ctx: click.Context, param: click.Option, value: str) -> str | Non def handle_content_file(ctx: click.Context, param: click.Option, value: str) -> str | None: """Handle the content file""" - if not value: - return None + if value is None: + return "" if value == "stdin": content = list() click.secho('Please enter the content. To finish, put a "." on a blank line.', fg="green") @@ -225,7 +225,7 @@ def handle_content_file(ctx: click.Context, param: click.Option, value: str) -> content.append(line) return "\n".join(content) path = Path(value) - if not path.exists(): + if not path.exists() or path.is_dir(): raise click.exceptions.BadParameter( f'Either the path to a file or "stdin" must be provided. {repr(value)} is invalid.' )