From d2cdb0e96d61e4105ba71b5b59a4ff3601f2f49a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Sun, 8 Nov 2026 12:40:14 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Preserve=20long=20lines=20in=20p?= =?UTF-8?q?rinted=20CI=20workflows?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/fastapi_cloud_cli/commands/ci/print_workflow.py | 2 +- tests/test_cli_ci.py | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/fastapi_cloud_cli/commands/ci/print_workflow.py b/src/fastapi_cloud_cli/commands/ci/print_workflow.py index 89d212c2..8e593cb7 100644 --- a/src/fastapi_cloud_cli/commands/ci/print_workflow.py +++ b/src/fastapi_cloud_cli/commands/ci/print_workflow.py @@ -20,7 +20,7 @@ class CIWorkflowOutput(BaseModel): def _render_workflow_output(data: CIWorkflowOutput, toolkit: RichToolkit) -> None: - toolkit.console.print(data.content, markup=False, end="") + toolkit.console.print(data.content, markup=False, end="", soft_wrap=True) @ci_app.command("print-workflow") diff --git a/tests/test_cli_ci.py b/tests/test_cli_ci.py index 10cff5a4..fa44453f 100644 --- a/tests/test_cli_ci.py +++ b/tests/test_cli_ci.py @@ -42,11 +42,14 @@ def test_print_workflow_uses_default_branch() -> None: assert result.stderr == "" -def test_print_workflow_uses_branch_option() -> None: - result = runner.invoke(app, ["ci", "print-workflow", "--branch", "main"]) +@pytest.mark.parametrize("branch", ["main", "feature/" + "long-branch-name-" * 8]) +def test_print_workflow_uses_branch_option(branch: str) -> None: + result = runner.invoke( + app, ["ci", "print-workflow", "--branch", branch], env={"COLUMNS": "80"} + ) assert result.exit_code == 0 - assert result.stdout == _get_workflow_content("main") + assert result.stdout == _get_workflow_content(branch) assert result.stderr == ""