Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def get_job_config_full(**kwargs):
""" pass kwargs to JobConfig constructor """
return JobConfig(
type=JobType.propose_downstream,
trigger=JobConfigTriggerType.pull_request,
metadata=JobMetadataConfig(dist_git_branches=["master"]),
**kwargs
)
JobConfig(
type=JobType.build,
trigger=JobConfigTriggerType.pull_request,
upstream_project_url="https://github.com/packit-service/ogr",
),
True,
),
],
)
def test_get_api(tmp_path, remotes, package_config, is_upstream):
repo = tmp_path / "project_repo"
repo.mkdir(parents=True, exist_ok=True)
initiate_git_repo(repo, remotes=remotes)
flexmock(utils).should_receive("get_local_package_config").and_return(
package_config
)
JobConfig(
type=JobType.build,
trigger=JobConfigTriggerType.release,
specfile_path="somewhere/package.spec",
synced_files=SyncFilesConfig(
[SyncFilesItem(x, x) for x in ("a", "b", "c")]
),
actions={ActionName.create_archive: "ls"},
spec_source_id="Source1",
)
],
),
id="override-alot",
),
],
)
def test_package_config_overrides(raw, expected):
JobConfig(
type=JobType.copr_build,
trigger=JobConfigTriggerType.pull_request,
metadata=JobMetadataConfig(project="example"),
)
],
),
"example",
),
(
PackageConfig(
specfile_path="xxx",
jobs=[
JobConfig(
type=JobType.copr_build,
trigger=JobConfigTriggerType.release,
metadata=JobMetadataConfig(project="example1"),
def get_job_config_simple(**kwargs):
""" pass kwargs to JobConfig constructor """
return JobConfig(type=JobType.build, trigger=JobConfigTriggerType.release, **kwargs)
def get_default_job_config(**kwargs):
""" pass kwargs to JobConfig constructor """
return [
JobConfig(
type=JobType.tests,
trigger=JobConfigTriggerType.pull_request,
metadata=JobMetadataConfig(targets=["fedora-stable"]),
**kwargs
),
JobConfig(
type=JobType.propose_downstream,
trigger=JobConfigTriggerType.release,
metadata=JobMetadataConfig(dist_git_branches=["fedora-all"]),
**kwargs
),
def get_job_config_build_for_branch(**kwargs):
""" pass kwargs to JobConfig constructor """
return JobConfig(
type=JobType.copr_build,
trigger=JobConfigTriggerType.commit,
metadata=JobMetadataConfig(branch="build-branch", scratch=True),
**kwargs
)