Exemple #1
0
def test_copr_build_cli_project_set_from_config(upstream_and_remote,
                                                copr_client_mock):
    upstream, _ = upstream_and_remote

    flexmock(PackageConfig).should_receive(
        "get_copr_build_project_value").and_return("some-project")
    flexmock(packit.copr_helper.CoprClient).should_receive(
        "create_from_config_file").and_return(copr_client_mock)
    CoprHelper.get_available_chroots.cache_clear()

    flexmock(PackitAPI).should_receive("run_copr_build").with_args(
        project="some-project",
        chroots=["fedora-rawhide-x86_64"],
        owner=None,
        description=None,
        instructions=None,
        upstream_ref=None,
        list_on_homepage=False,
        preserve_project=False,
        additional_repos=None,
        request_admin_if_needed=False,
        enable_net=True,
        release_suffix=None,
        srpm_path=None,
    ).and_return(("id", "url")).once()

    run_packit(["build", "in-copr", "--nowait"], working_dir=upstream)
Exemple #2
0
def test_copr_build_cli_no_project_configured(upstream_and_remote):
    upstream, _ = upstream_and_remote
    flexmock(PackitAPI).should_receive("run_copr_build").with_args(
        project="packit-cli-upstream_remote-upstream_git-master",
        chroots=["fedora-rawhide-x86_64"],
        owner=None,
        description=None,
        instructions=None,
        upstream_ref=None,
        list_on_homepage=False,
        preserve_project=False,
        additional_repos=None,
        request_admin_if_needed=False,
    ).and_return(("id", "url")).once()

    run_packit(["copr-build", "--nowait"], working_dir=upstream)
Exemple #3
0
def test_copr_build_cli_no_project_configured(upstream_and_remote,
                                              copr_client_mock):
    upstream, _ = upstream_and_remote
    flexmock(PackitAPI).should_receive("run_copr_build").with_args(
        project="packit-cli-upstream_remote-upstream_git-main",
        chroots=["fedora-rawhide-x86_64"],
        owner=None,
        description=None,
        instructions=None,
        upstream_ref=None,
        list_on_homepage=False,
        preserve_project=False,
        additional_repos=None,
        request_admin_if_needed=False,
    ).and_return(("id", "url")).once()

    flexmock(packit.copr_helper.CoprClient).should_receive(
        "create_from_config_file").and_return(copr_client_mock)
    CoprHelper.get_available_chroots.cache_clear()

    run_packit(["copr-build", "--nowait"], working_dir=upstream)