1
0
mirror of https://github.com/pyenv/pyenv.git synced 2025-11-10 04:23:47 -05:00

Rewrite python-build tests with using PYTHON_BUILD_HTTP_CLIENT

This commit is contained in:
Yamashita, Yuu
2018-04-24 05:22:32 +00:00
parent fc90785f75
commit 098fb9f07a
7 changed files with 7 additions and 41 deletions

View File

@@ -9,35 +9,6 @@ if [ "$FIXTURE_ROOT" != "$BATS_TEST_DIRNAME/fixtures" ]; then
export PATH
fi
remove_command_from_path() {
OLDIFS="${IFS}"
local cmd="$1"
local path
local paths=()
IFS=:
for path in ${PATH}; do
if [ -e "${path}/${cmd}" ]; then
local tmp_path="$(mktemp -d "${TMP}/path.XXXXX")"
ln -fs "${path}"/* "${tmp_path}"
rm -f "${tmp_path}/${cmd}"
paths["${#paths[@]}"]="${tmp_path}"
else
paths["${#paths[@]}"]="${path}"
fi
done
export PATH="${paths[*]}"
IFS="${OLDIFS}"
}
ensure_not_found_in_path() {
local cmd
for cmd; do
if command -v "${cmd}" 1>/dev/null 2>&1; then
remove_command_from_path "${cmd}"
fi
done
}
teardown() {
rm -fr "${TMP:?}"/*
}