Пример #1
0
def test_get_build_logs_for_build_pr(clean_before_and_after,
                                     a_copr_build_for_pr):
    response = _get_build_info(a_copr_build_for_pr,
                               build_description="COPR build")
    assert "We can't find any info" not in response
    assert "Builds for the-namespace/the-repo-name: PR #342" in response
    assert a_copr_build_for_pr.status in response
    assert a_copr_build_for_pr.target in response
    assert str(a_copr_build_for_pr.srpm_build_id) in response
    assert a_copr_build_for_pr.build_logs_url in response
    assert f"Status: {a_copr_build_for_pr.status}" in response
    assert "For more info see" in response
    assert "You can install the built RPMs by following these steps" not in response

    a_copr_build_for_pr.status = SampleValues.status_success
    response = _get_build_info(a_copr_build_for_pr,
                               build_description="COPR build")
    assert "You can install the built RPMs by following these steps" in response
    assert (
        "Please note that the RPMs should be used only in a testing environment."
        in response)
Пример #2
0
def test_get_build_logs_for_build_pr(clean_before_and_after,
                                     a_copr_build_for_pr):
    flexmock(models).should_receive("optional_time").and_return(
        "2020-05-19 16:17:14 UTC")

    response = _get_build_info(a_copr_build_for_pr,
                               build_description="COPR build")
    assert "We can't find any info" not in response
    assert "Builds for the-namespace/the-repo-name: PR #342" in response
    assert "2020-05-19 16:17:14 UTC" in response
    assert a_copr_build_for_pr.status in response
    assert a_copr_build_for_pr.target in response
    assert str(a_copr_build_for_pr.srpm_build_id) in response
    assert a_copr_build_for_pr.build_logs_url in response
Пример #3
0
def test_koji_build_info_view(client, clean_before_and_after,
                              a_koji_build_for_pr):
    response = client.get(
        url_for("builds.koji_build_info", id_=str(a_koji_build_for_pr.id)))
    response = response.data.decode()

    assert "Builds for the-namespace/the-repo-name: PR #342" in response
    assert a_koji_build_for_pr.status in response
    assert a_koji_build_for_pr.target in response
    assert str(a_koji_build_for_pr.srpm_build_id) in response
    assert a_koji_build_for_pr.build_logs_url in response
    assert f"Status: {a_koji_build_for_pr.status}" in response
    assert "For more info see" in response
    assert "You can install the built RPMs by following these steps" not in response

    a_koji_build_for_pr.status = SampleValues.status_success
    response = _get_build_info(a_koji_build_for_pr,
                               build_description="COPR build")
    # no installation instructions for koji build
    assert "You can install the built RPMs by following these steps" not in response