Public Access
DEVX-162: fix: read Gitea repo-variable data field; fail closed on unknown nightly status
This commit was merged in pull request #319.
This commit is contained in:
@@ -71,6 +71,17 @@ class TestCli:
|
||||
assert result.exit_code != 0
|
||||
assert "blocked" in result.output.lower()
|
||||
|
||||
@patch("devx.ci.nightly_gate.GiteaClient")
|
||||
@patch("devx.ci.nightly_gate.get_ci_token")
|
||||
def test_check_unknown_status_blocks_deploy(self, mock_token: MagicMock, mock_client_cls: MagicMock) -> None:
|
||||
mock_token.return_value = "fake-token"
|
||||
mock_client = mock_client_cls.return_value
|
||||
mock_client.get_repo_variable.return_value = "garbage-value"
|
||||
runner = CliRunner()
|
||||
result = runner.invoke(cli, ["--repo", "oblachno/infra", "--action", "check"])
|
||||
assert result.exit_code != 0
|
||||
assert "fail closed" in result.output.lower()
|
||||
|
||||
@patch("devx.ci.nightly_gate.GiteaClient")
|
||||
@patch("devx.ci.nightly_gate.get_ci_token")
|
||||
def test_set_passed(self, mock_token: MagicMock, mock_client_cls: MagicMock) -> None:
|
||||
|
||||
Reference in New Issue
Block a user