Skip to content

Commit beca456

Browse files
Simplify test
1 parent 85a6d99 commit beca456

1 file changed

Lines changed: 2 additions & 8 deletions

File tree

tests/test_cli_setup_ci.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import subprocess
2-
from pathlib import Path
32
from unittest.mock import patch
43

54
import pytest
@@ -39,11 +38,8 @@ def test_shows_login_message_when_not_logged_in(logged_out_cli: None) -> None:
3938
assert "No credentials found" in result.output
4039

4140

42-
def test_shows_error_when_app_not_configured(
43-
logged_in_cli: None, tmp_path: Path
44-
) -> None:
45-
with changing_dir(tmp_path):
46-
result = runner.invoke(app, ["setup-ci"])
41+
def test_shows_message_if_app_not_configured(logged_in_cli: None) -> None:
42+
result = runner.invoke(app, ["setup-ci"])
4743

4844
assert result.exit_code == 1
4945
assert "No app linked to this directory" in result.output
@@ -360,11 +356,9 @@ def test_creates_token_sets_secrets_and_writes_workflow(
360356
assert "Done" in result.output
361357
assert "2027-02-18" in result.output
362358

363-
# Verify secrets were set
364359
mock_secret.assert_any_call("FASTAPI_CLOUD_TOKEN", "test-token-value")
365360
mock_secret.assert_any_call("FASTAPI_CLOUD_APP_ID", app_id)
366361

367-
# Verify workflow file was written with correct content
368362
workflow_file = configured_app.path / ".github" / "workflows" / "deploy.yml"
369363
assert workflow_file.exists()
370364
content = workflow_file.read_text()

0 commit comments

Comments
 (0)