Bläddra i källkod

Add test for custom `GET_PIP_URL` per versions

pull/1131/head
Yamashita, Yuu 8 år sedan
förälder
incheckning
a1d39c1e25
1 ändrade filer med 53 tillägg och 0 borttagningar
  1. +53
    -0
      plugins/python-build/test/pyenv_ext.bats

+ 53
- 0
plugins/python-build/test/pyenv_ext.bats Visa fil

@ -92,6 +92,19 @@ resolve_link() {
$(type -p greadlink readlink | head -1) "$1"
}
run_inline_definition_with_name() {
local definition_name="build-definition"
case "$1" in
"--name="* )
local definition_name="${1#--name=}"
shift 1
;;
esac
local definition="${TMP}/${definition_name}"
cat > "$definition"
run python-build "$definition" "${1:-$INSTALL_ROOT}"
}
@test "apply built-in python patch before building" {
cached_tarball "Python-3.6.2"
@ -326,3 +339,43 @@ OUT
assert_success
assert_output "10.4"
}
@test "use the default EZ_SETUP_URL by default" {
run_inline_definition <<OUT
echo "\${EZ_SETUP_URL}"
OUT
assert_output "https://bootstrap.pypa.io/ez_setup.py"
assert_success
}
@test "use the default GET_PIP_URL by default" {
run_inline_definition <<OUT
echo "\${GET_PIP_URL}"
OUT
assert_output "https://bootstrap.pypa.io/get-pip.py"
assert_success
}
@test "use the custom GET_PIP_URL for 2.6 versions" {
run_inline_definition_with_name --name=2.6 <<OUT
echo "\${GET_PIP_URL}"
OUT
assert_output "https://bootstrap.pypa.io/2.6/get-pip.py"
assert_success
}
@test "use the custom GET_PIP_URL for 3.2 versions" {
run_inline_definition_with_name --name=3.2 <<OUT
echo "\${GET_PIP_URL}"
OUT
assert_output "https://bootstrap.pypa.io/3.2/get-pip.py"
assert_success
}
@test "use the custom GET_PIP_URL for 3.3 versions" {
run_inline_definition_with_name --name=3.3 <<OUT
echo "\${GET_PIP_URL}"
OUT
assert_output "https://bootstrap.pypa.io/3.3/get-pip.py"
assert_success
}

Laddar…
Avbryt
Spara