1
0
mirror of https://github.com/pyenv/pyenv.git synced 2025-11-14 14:23:53 -05:00

Import changes from ruby-build v20140524

This commit is contained in:
Yamashita Yuu
2014-06-03 11:41:47 +09:00
parent 3290973990
commit 9dac275567
7 changed files with 158 additions and 66 deletions

View File

@@ -10,7 +10,7 @@ setup() {
@test "packages are saved to download cache" {
stub md5 true
stub shasum true
stub curl "-q -o * -*S* http://example.com/* : cp $FIXTURE_ROOT/\${5##*/} \$3"
install_fixture definitions/without-checksum
@@ -18,12 +18,12 @@ setup() {
[ -e "${PYTHON_BUILD_CACHE_PATH}/package-1.0.0.tar.gz" ]
unstub curl
unstub md5
unstub shasum
}
@test "cached package without checksum" {
stub md5 true
stub shasum true
stub curl
cp "${FIXTURE_ROOT}/package-1.0.0.tar.gz" "$PYTHON_BUILD_CACHE_PATH"
@@ -33,12 +33,12 @@ setup() {
[ -e "${PYTHON_BUILD_CACHE_PATH}/package-1.0.0.tar.gz" ]
unstub curl
unstub md5
unstub shasum
}
@test "cached package with valid checksum" {
stub md5 true "echo 83e6d7725e20166024a1eb74cde80677"
stub shasum true "echo ba988b1bb4250dee0b9dd3d4d722f9c64b2bacfc805d1b6eba7426bda72dd3c5"
stub curl
cp "${FIXTURE_ROOT}/package-1.0.0.tar.gz" "$PYTHON_BUILD_CACHE_PATH"
@@ -49,15 +49,15 @@ setup() {
[ -e "${PYTHON_BUILD_CACHE_PATH}/package-1.0.0.tar.gz" ]
unstub curl
unstub md5
unstub shasum
}
@test "cached package with invalid checksum falls back to mirror and updates cache" {
export PYTHON_BUILD_SKIP_MIRROR=
local checksum="83e6d7725e20166024a1eb74cde80677"
local checksum="ba988b1bb4250dee0b9dd3d4d722f9c64b2bacfc805d1b6eba7426bda72dd3c5"
stub md5 true "echo invalid" "echo $checksum"
stub shasum true "echo invalid" "echo $checksum"
stub curl "-*I* : true" \
"-q -o * -*S* http://?*/$checksum : cp $FIXTURE_ROOT/package-1.0.0.tar.gz \$3"
@@ -70,12 +70,12 @@ setup() {
diff -q "${PYTHON_BUILD_CACHE_PATH}/package-1.0.0.tar.gz" "${FIXTURE_ROOT}/package-1.0.0.tar.gz"
unstub curl
unstub md5
unstub shasum
}
@test "nonexistent cache directory is ignored" {
stub md5 true
stub shasum true
stub curl "-q -o * -*S* http://example.com/* : cp $FIXTURE_ROOT/\${5##*/} \$3"
export PYTHON_BUILD_CACHE_PATH="${TMP}/nonexistent"
@@ -86,5 +86,5 @@ setup() {
[ ! -d "$PYTHON_BUILD_CACHE_PATH" ]
unstub curl
unstub md5
unstub shasum
}