Exemplo n.º 1
0
def test_circle_should_raise_ci_verification_error_for_wrong_branch(
        monkeypatch):
    monkeypatch.setenv("CIRCLE_BRANCH", "other-branch")
    monkeypatch.setenv("CI_PULL_REQUEST", "")

    with pytest.raises(CiVerificationError):
        ci_checks.circle("master")
Exemplo n.º 2
0
def test_circle_should_pass_if_branch_is_master_and_no_pr(monkeypatch):
    monkeypatch.setenv("CIRCLE_BRANCH", "master")
    monkeypatch.setenv("CI_PULL_REQUEST", "")

    assert ci_checks.circle("master")
Exemplo n.º 3
0
def test_circle_should_pass_if_branch_is_correct_and_no_pr(monkeypatch):
    monkeypatch.setenv("CIRCLE_BRANCH", "other-branch")
    monkeypatch.setenv("CI_PULL_REQUEST", "")

    assert ci_checks.circle("other-branch")
Exemplo n.º 4
0
def test_circle_should_pass_if_branch_is_master_and_no_pr(monkeypatch):
    monkeypatch.setenv('CIRCLE_BRANCH', 'master')
    monkeypatch.setenv('CI_PULL_REQUEST', '')

    assert ci_checks.circle('master')
Exemplo n.º 5
0
def test_circle_should_raise_ci_verification_error_for_pr(monkeypatch):
    monkeypatch.setenv('CIRCLE_BRANCH', 'other-branch')
    monkeypatch.setenv('CI_PULL_REQUEST', 'http://the-url-of-the-pr')

    with pytest.raises(CiVerificationError):
        ci_checks.circle('master')
Exemplo n.º 6
0
def test_circle_should_pass_if_branch_is_correct_and_no_pr(monkeypatch):
    monkeypatch.setenv('CIRCLE_BRANCH', 'other-branch')
    monkeypatch.setenv('CI_PULL_REQUEST', '')

    assert ci_checks.circle('other-branch')