Skip to content

Commit 1e611ca

Browse files
committed
Specify min value for --large-file-threshold option
1 parent d166877 commit 1e611ca

2 files changed

Lines changed: 15 additions & 1 deletion

File tree

src/fastapi_cloud_cli/commands/deploy.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -699,7 +699,10 @@ def deploy(
699699
] = None,
700700
large_file_threshold: Annotated[
701701
int,
702-
typer.Option(help="File size threshold in MB for warning about large files"),
702+
typer.Option(
703+
help="File size threshold in MB for warning about large files",
704+
min=1,
705+
),
703706
] = 10, # 10 MB
704707
) -> Any:
705708
"""

tests/test_cli_deploy.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2314,3 +2314,14 @@ def test_large_file_threshold_custom_threshold(
23142314
assert result.exit_code == 0
23152315
assert "Some uploaded files are larger than 1 MB" in result.output
23162316
assert "data.bin" in result.output
2317+
2318+
2319+
@pytest.mark.respx
2320+
def test_invalid_large_file_threshold(
2321+
logged_in_cli: None, tmp_path: Path, respx_mock: respx.MockRouter
2322+
) -> None:
2323+
with changing_dir(tmp_path):
2324+
result = runner.invoke(app, ["deploy", "--large-file-threshold", "0"])
2325+
2326+
assert result.exit_code == 2
2327+
assert "Invalid value for '--large-file-threshold'" in result.output

0 commit comments

Comments
 (0)