def test_srpm_custom_path(upstream_instance): u, ups = upstream_instance custom_path = "sooooorc.rpm" call_real_packit(parameters=["--debug", "srpm", "--output", custom_path], cwd=u) srpm_path = u.joinpath(custom_path) assert srpm_path.is_file() build_srpm(srpm_path)
def test_srpm_upstream_ref_head(upstream_instance): u, ups = upstream_instance custom_ref = "HEAD" call_real_packit( parameters=["--debug", "srpm", "--upstream-ref", custom_ref], cwd=u ) assert list(u.glob("*.src.rpm"))[0].exists()
def test_srpm_upstream_ref_commit(upstream_instance_with_two_commits): u, ups = upstream_instance_with_two_commits custom_ref = ups.local_project.git_repo.commit("HEAD~").hexsha call_real_packit( parameters=["--debug", "srpm", "--upstream-ref", custom_ref], cwd=u ) assert list(u.glob("*.src.rpm"))[0].exists()
def test_srpm_upstream_ref(upstream_instance_with_two_commits): u, ups = upstream_instance_with_two_commits custom_ref = "HEAD~" call_real_packit( parameters=["--debug", "srpm", "--upstream-ref", custom_ref], cwd=u ) assert list(u.glob("*.src.rpm"))[0].exists()
def test_srpm_upstream_ref_branch(upstream_instance_with_two_commits): custom_ref = "new_branch" u, ups = upstream_instance_with_two_commits ups.local_project.git_repo.create_head(custom_ref) call_real_packit( parameters=["--debug", "srpm", "--upstream-ref", custom_ref], cwd=u ) assert list(u.glob("*.src.rpm"))[0].exists()
def test_srpm_twice(upstream_instance): u, ups = upstream_instance call_real_packit(parameters=["--debug", "srpm"], cwd=u) call_real_packit(parameters=["--debug", "srpm"], cwd=u) # since we build from the 0.1.0, we would get the same SRPM because of '--new 0.1.0' srpm_files = list(u.glob("*.src.rpm")) assert srpm_files[0].exists() build_srpm(srpm_files[0])
def test_srpm_twice_with_custom_name(upstream_instance): u, ups = upstream_instance custom_path = "sooooorc.rpm" call_real_packit(parameters=["--debug", "srpm", "--output", custom_path], cwd=u) srpm_path1 = u.joinpath(custom_path) assert srpm_path1.is_file() build_srpm(srpm_path1) custom_path2 = "sooooorc2.rpm" call_real_packit(parameters=["--debug", "srpm", "--output", custom_path2], cwd=u) srpm_path2 = u.joinpath(custom_path2) assert srpm_path2.is_file() build_srpm(srpm_path2)
def test_srpm_command(upstream_instance): u, ups = upstream_instance call_real_packit(parameters=["--debug", "srpm"], cwd=u) assert list(u.glob("*.src.rpm"))[0].exists()