Exemplo n.º 1
0
import os

from conda.core import package_cache_data as pcd
from conda.exports import url_path
from conda.core.index import get_index

CONDA_PKG_REPO = url_path(
    os.path.join(os.path.dirname(__file__), '..', 'data', 'conda_format_repo'))


def test_ProgressiveFetchExtract_prefers_conda_v2_format():
    index = get_index([CONDA_PKG_REPO], prepend=False)
    rec = next(iter(index))
    cache_action, extract_action = pcd.ProgressiveFetchExtract.make_actions_for_record(
        rec)

    assert cache_action.target_package_basename.endswith('.conda')
    assert cache_action.sha256sum == rec.conda_outer_sha256
    assert cache_action.expected_size_in_bytes == rec.conda_size

    assert extract_action.source_full_path.endswith('.conda')
    assert extract_action.sha256sum == rec.conda_outer_sha256
Exemplo n.º 2
0
from conda.base.context import conda_tests_ctxt_mgmt_def_pol
from conda.common.io import env_vars, env_var
from conda.core.index import get_index
from conda.core.package_cache_data import PackageCacheData, ProgressiveFetchExtract
from conda.core.path_actions import CacheUrlAction
from conda.exceptions import ChecksumMismatchError
from conda.exports import url_path
from conda.gateways.disk.create import copy
from conda.gateways.disk.permissions import make_read_only
from conda.gateways.disk.read import isfile, listdir, yield_lines
from conda.models.records import PackageRecord
from tests.test_create import make_temp_package_cache

CHANNEL_DIR = abspath(
    join(dirname(__file__), '..', 'data', 'conda_format_repo'))
CONDA_PKG_REPO = url_path(CHANNEL_DIR)

subdir = "win-64"
zlib_base_fn = "zlib-1.2.11-h62dcd97_3"
zlib_tar_bz2_fn = "zlib-1.2.11-h62dcd97_3.tar.bz2"
zlib_tar_bz2_prec = PackageRecord.from_objects(
    {
        "build": "h62dcd97_3",
        "build_number": 3,
        "depends": ["vc >=14.1,<15.0a0"],
        "license": "zlib",
        "license_family": "Other",
        "md5": "a46cf10ba0eece37dffcec2d45a1f4ec",
        "name": "zlib",
        "sha256":
        "10363f6c023d7fb3d11fdb4cc8de59b5ad5c6affdf960210dd95a252a3fced2b",
Exemplo n.º 3
0
from conda.base.constants import PACKAGE_CACHE_MAGIC_FILE
from conda.base.context import conda_tests_ctxt_mgmt_def_pol
from conda.common.io import env_vars
from conda.core.index import get_index
from conda.core.package_cache_data import PackageCacheData, ProgressiveFetchExtract
from conda.core.path_actions import CacheUrlAction
from conda.exceptions import ChecksumMismatchError
from conda.exports import url_path
from conda.gateways.disk.create import copy
from conda.gateways.disk.permissions import make_read_only
from conda.gateways.disk.read import isfile, listdir, yield_lines
from conda.models.records import PackageRecord
from tests.test_create import make_temp_package_cache

CHANNEL_DIR = abspath(join(dirname(__file__), '..', 'data', 'conda_format_repo'))
CONDA_PKG_REPO = url_path(CHANNEL_DIR)

subdir = "win-64"
zlib_base_fn = "zlib-1.2.11-h62dcd97_3"
zlib_tar_bz2_fn = "zlib-1.2.11-h62dcd97_3.tar.bz2"
zlib_tar_bz2_prec = PackageRecord.from_objects({
      "build": "h62dcd97_3",
      "build_number": 3,
      "depends": [
        "vc >=14.1,<15.0a0"
      ],
      "license": "zlib",
      "license_family": "Other",
      "md5": "a46cf10ba0eece37dffcec2d45a1f4ec",
      "name": "zlib",
      "sha256": "10363f6c023d7fb3d11fdb4cc8de59b5ad5c6affdf960210dd95a252a3fced2b",