コード例 #1
0
def _build_test_index(workdir):
    pkgs = api.build(os.path.join(metadata_dir, "_index_hotfix_pkgs"),
                     croot=workdir)
    for pkg in pkgs:
        conda_package_handling.api.transmute(pkg, '.conda')
    api.update_index(workdir)

    with open(os.path.join(workdir, subdir, 'repodata.json')) as f:
        original_metadata = json.load(f)

    pkg_list = original_metadata['packages']
    assert "track_features_test-1.0-0.tar.bz2" in pkg_list
    assert pkg_list["track_features_test-1.0-0.tar.bz2"][
        "track_features"] == "dummy"

    assert "hotfix_depends_test-1.0-dummy_0.tar.bz2" in pkg_list
    assert pkg_list["hotfix_depends_test-1.0-dummy_0.tar.bz2"][
        "features"] == "dummy"
    assert "zlib" in pkg_list["hotfix_depends_test-1.0-dummy_0.tar.bz2"][
        "depends"]

    assert "revoke_test-1.0-0.tar.bz2" in pkg_list
    assert "zlib" in pkg_list["revoke_test-1.0-0.tar.bz2"]["depends"]
    assert "package_has_been_revoked" not in pkg_list[
        "revoke_test-1.0-0.tar.bz2"]["depends"]

    assert "remove_test-1.0-0.tar.bz2" in pkg_list
コード例 #2
0
ファイル: test_index.py プロジェクト: uilianries/conda-build
def test_index_of_removed_pkg(testing_metadata):
    out_files = api.build(testing_metadata)
    for f in out_files:
        os.remove(f)
    api.update_index(testing_metadata.config.croot)
    with open(
            os.path.join(testing_metadata.config.croot, subdir,
                         'repodata.json')) as f:
        repodata = json.load(f)
    assert not repodata['packages']
コード例 #3
0
ファイル: test_index.py プロジェクト: conda/conda-build
def test_index_of_removed_pkg(testing_metadata):
    out_files = api.build(testing_metadata)
    for f in out_files:
        os.remove(f)
    api.update_index(testing_metadata.config.croot)
    with open(os.path.join(testing_metadata.config.croot, subdir, 'repodata.json')) as f:
        repodata = json.load(f)
    assert not repodata['packages']
    with open(os.path.join(testing_metadata.config.croot, subdir, 'repodata_from_packages.json')) as f:
        repodata = json.load(f)
    assert not repodata['packages']
コード例 #4
0
ファイル: test_index.py プロジェクト: conda/conda-build
def _build_test_index(workdir):
    pkgs = api.build(os.path.join(metadata_dir, "_index_hotfix_pkgs"), croot=workdir)
    for pkg in pkgs:
        conda_package_handling.api.transmute(pkg, '.conda')
    api.update_index(workdir)

    with open(os.path.join(workdir, subdir, 'repodata.json')) as f:
        original_metadata = json.load(f)

    pkg_list = original_metadata['packages']
    assert "track_features_test-1.0-0.tar.bz2" in pkg_list
    assert pkg_list["track_features_test-1.0-0.tar.bz2"]["track_features"] == "dummy"

    assert "hotfix_depends_test-1.0-dummy_0.tar.bz2" in pkg_list
    assert pkg_list["hotfix_depends_test-1.0-dummy_0.tar.bz2"]["features"] == "dummy"
    assert "zlib" in pkg_list["hotfix_depends_test-1.0-dummy_0.tar.bz2"]["depends"]

    assert "revoke_test-1.0-0.tar.bz2" in pkg_list
    assert "zlib" in pkg_list["revoke_test-1.0-0.tar.bz2"]["depends"]
    assert "package_has_been_revoked" not in pkg_list["revoke_test-1.0-0.tar.bz2"]["depends"]

    assert "remove_test-1.0-0.tar.bz2" in pkg_list