Exemplo n.º 1
0
def test_dist_git_package_url():
    di = {
        "dist_git_base_url": "https://packit.dev/",
        "downstream_package_name": "packit",
        "dist_git_namespace": "awesome",
        "synced_files": ["fedora/foobar.spec"],
        "specfile_path": "fedora/package.spec",
        "create_pr": False,
    }
    new_pc = PackageConfig.get_from_dict(di)
    pc = PackageConfig(
        dist_git_base_url="https://packit.dev/",
        downstream_package_name="packit",
        dist_git_namespace="awesome",
        synced_files=SyncFilesConfig(files_to_sync=[
            SyncFilesItem(src="fedora/foobar.spec", dest="fedora/foobar.spec")
        ]),
        specfile_path="fedora/package.spec",
        create_pr=False,
        jobs=get_default_job_config(),
    )
    assert new_pc.specfile_path.endswith("fedora/package.spec")
    assert pc.specfile_path.endswith("fedora/package.spec")
    assert pc == new_pc
    assert pc.dist_git_package_url == "https://packit.dev/awesome/packit.git"
    assert new_pc.dist_git_package_url == "https://packit.dev/awesome/packit.git"
    assert not pc.create_pr
Exemplo n.º 2
0
     {
         "specfile_path": "fedora/package.spec",
         "synced_files": ["fedora/package.spec"],
         "downstream_package_name": "package",
     },
     PackageConfig(
         downstream_package_name="package",
         specfile_path="fedora/package.spec",
         synced_files=SyncFilesConfig(files_to_sync=[
             SyncFilesItem(src="fedora/package.spec",
                           dest="fedora/package.spec")
         ]),
         jobs=get_default_job_config(
             downstream_package_name="package",
             specfile_path="fedora/package.spec",
             synced_files=SyncFilesConfig(files_to_sync=[
                 SyncFilesItem(src="fedora/package.spec",
                               dest="fedora/package.spec")
             ]),
         ),
     ),
     id="specfile_path+synced_files+downstream_package_name",
 ),
 pytest.param(
     {
         "specfile_path": "fedora/package.spec",
         "spec_source_id": 3,
         "jobs": [get_job_config_dict_build_for_branch()],
     },
     PackageConfig(
         specfile_path="fedora/package.spec",
         spec_source_id="Source3",
Exemplo n.º 3
0
     id="specfile_path+actions+empty_jobs+upstream_project_url"
     "+upstream_package_name+dist_git_base_url+downstream_package_name",
 ),
 pytest.param(
     {
         "specfile_path": "fedora/package.spec",
         "synced_files": ["fedora/package.spec"],
         "downstream_package_name": "package",
     },
     PackageConfig(
         specfile_path="fedora/package.spec",
         synced_files=SyncFilesConfig(files_to_sync=[
             SyncFilesItem(src="fedora/package.spec",
                           dest="fedora/package.spec")
         ]),
         jobs=get_default_job_config(),
         downstream_package_name="package",
     ),
     id="specfile_path+synced_files+downstream_package_name",
 ),
 pytest.param(
     {
         "specfile_path": "fedora/package.spec",
         "jobs": [get_job_config_dict_build_for_branch()],
     },
     PackageConfig(
         specfile_path="fedora/package.spec",
         jobs=[get_job_config_build_for_branch()],
     ),
     id="specfile_path+get_job_config_dict_build_for_branch",
 ),