1
0
mirror of https://github.com/pyenv/pyenv.git synced 2025-11-13 22:03:52 -05:00

Import recent changes from ruby-build 20160130

This commit is contained in:
Yamashita, Yuu
2016-02-08 00:01:02 +00:00
parent f2f703d6d9
commit c8ab429d7b
11 changed files with 195 additions and 145 deletions

View File

@@ -6,15 +6,14 @@ export PYTHON_BUILD_CACHE_PATH=
@test "package URL without checksum" {
stub shasum true
stub curl "-q -o * -*S* http://example.com/* : cp $FIXTURE_ROOT/\${5##*/} \$3"
install_fixture definitions/without-checksum
[ "$status" -eq 0 ]
[ -x "${INSTALL_ROOT}/bin/package" ]
assert_success
assert [ -x "${INSTALL_ROOT}/bin/package" ]
unstub curl
unstub shasum
}
@@ -23,8 +22,9 @@ export PYTHON_BUILD_CACHE_PATH=
stub curl "-q -o * -*S* http://example.com/* : cp $FIXTURE_ROOT/\${5##*/} \$3"
install_fixture definitions/with-checksum
[ "$status" -eq 0 ]
[ -x "${INSTALL_ROOT}/bin/package" ]
assert_success
assert [ -x "${INSTALL_ROOT}/bin/package" ]
unstub curl
unstub shasum
@@ -36,8 +36,9 @@ export PYTHON_BUILD_CACHE_PATH=
stub curl "-q -o * -*S* http://example.com/* : cp $FIXTURE_ROOT/\${5##*/} \$3"
install_fixture definitions/with-invalid-checksum
[ "$status" -eq 1 ]
[ ! -f "${INSTALL_ROOT}/bin/package" ]
assert_failure
refute [ -f "${INSTALL_ROOT}/bin/package" ]
unstub curl
unstub shasum
@@ -49,8 +50,9 @@ export PYTHON_BUILD_CACHE_PATH=
stub curl "-q -o * -*S* http://example.com/* : cp $FIXTURE_ROOT/\${5##*/} \$3"
install_fixture definitions/with-checksum
[ "$status" -eq 0 ]
[ -x "${INSTALL_ROOT}/bin/package" ]
assert_success
assert [ -x "${INSTALL_ROOT}/bin/package" ]
unstub curl
unstub shasum
@@ -62,8 +64,9 @@ export PYTHON_BUILD_CACHE_PATH=
stub curl "-q -o * -*S* http://example.com/* : cp $FIXTURE_ROOT/\${5##*/} \$3"
install_fixture definitions/with-md5-checksum
[ "$status" -eq 0 ]
[ -x "${INSTALL_ROOT}/bin/package" ]
assert_success
assert [ -x "${INSTALL_ROOT}/bin/package" ]
unstub curl
unstub md5
@@ -75,8 +78,9 @@ export PYTHON_BUILD_CACHE_PATH=
stub curl "-q -o * -*S* http://example.com/* : cp $FIXTURE_ROOT/\${5##*/} \$3"
install_fixture definitions/with-md5-checksum
[ "$status" -eq 0 ]
[ -x "${INSTALL_ROOT}/bin/package" ]
assert_success
assert [ -x "${INSTALL_ROOT}/bin/package" ]
unstub curl
unstub md5
@@ -88,8 +92,9 @@ export PYTHON_BUILD_CACHE_PATH=
stub curl "-q -o * -*S* http://example.com/* : cp $FIXTURE_ROOT/\${5##*/} \$3"
install_fixture definitions/with-checksum
[ "$status" -eq 1 ]
[ ! -f "${INSTALL_ROOT}/bin/package" ]
assert_failure
refute [ -f "${INSTALL_ROOT}/bin/package" ]
unstub curl
unstub shasum
@@ -111,7 +116,7 @@ install_package "package-1.0.0" "http://example.com/packages/package-1.0.0.tar.g
DEF
assert_success
[ -x "${INSTALL_ROOT}/bin/package" ]
assert [ -x "${INSTALL_ROOT}/bin/package" ]
unstub shasum
}
@@ -133,7 +138,20 @@ install_package "package-1.0.0" "http://example.com/packages/package-1.0.0.tar.g
DEF
assert_success
[ -x "${INSTALL_ROOT}/bin/package" ]
assert [ -x "${INSTALL_ROOT}/bin/package" ]
unstub shasum
}
@test "package URL with checksum of unexpected length" {
stub curl "-q -o * -*S* http://example.com/* : cp $FIXTURE_ROOT/\${5##*/} \$3"
run_inline_definition <<DEF
install_package "package-1.0.0" "http://example.com/packages/package-1.0.0.tar.gz#checksum_of_unexpected_length" copy
DEF
assert_failure
refute [ -f "${INSTALL_ROOT}/bin/package" ]
assert_output_contains "unexpected checksum length: 29 (checksum_of_unexpected_length)"
assert_output_contains "expected 0 (no checksum), 32 (MD5), or 64 (SHA2-256)"
}