コード例 #1
0
def test_travis_should_raise_ci_verification_error_for_wrong_branch(
        monkeypatch):
    monkeypatch.setenv("TRAVIS_BRANCH", "other-branch")
    monkeypatch.setenv("TRAVIS_PULL_REQUEST", "false")

    with pytest.raises(CiVerificationError):
        ci_checks.travis("master")
コード例 #2
0
def test_travis_should_pass_if_branch_is_master_and_no_pr(monkeypatch):
    monkeypatch.setenv("TRAVIS_BRANCH", "master")
    monkeypatch.setenv("TRAVIS_PULL_REQUEST", "false")

    assert ci_checks.travis("master")
コード例 #3
0
def test_travis_should_pass_if_branch_is_correct_and_no_pr(monkeypatch):
    monkeypatch.setenv("TRAVIS_BRANCH", "other-branch")
    monkeypatch.setenv("TRAVIS_PULL_REQUEST", "false")

    assert ci_checks.travis("other-branch")
コード例 #4
0
def test_travis_should_pass_if_branch_is_master_and_no_pr(monkeypatch):
    monkeypatch.setenv('TRAVIS_BRANCH', 'master')
    monkeypatch.setenv('TRAVIS_PULL_REQUEST', 'false')

    assert ci_checks.travis('master')
コード例 #5
0
def test_travis_should_raise_ci_verification_error_for_pr(monkeypatch):
    monkeypatch.setenv('TRAVIS_BRANCH', 'other-branch')
    monkeypatch.setenv('TRAVIS_PULL_REQUEST', '42')

    with pytest.raises(CiVerificationError):
        ci_checks.travis('master')
コード例 #6
0
def test_travis_should_pass_if_branch_is_correct_and_no_pr(monkeypatch):
    monkeypatch.setenv('TRAVIS_BRANCH', 'other-branch')
    monkeypatch.setenv('TRAVIS_PULL_REQUEST', 'false')

    assert ci_checks.travis('other-branch')