mirror of
https://github.com/pyenv/pyenv.git
synced 2024-11-07 20:31:01 -05:00
Add test for /bin/python
case
This commit is contained in:
parent
4df7cf2dd6
commit
5c83c4abb7
2 changed files with 10 additions and 1 deletions
|
@ -24,6 +24,15 @@ load test_helper
|
||||||
assert_success "$PYENV_TEST_DIR"
|
assert_success "$PYENV_TEST_DIR"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@test "prefix for system in /" {
|
||||||
|
mkdir -p "${PYENV_TEST_DIR}/bin"
|
||||||
|
touch "${PYENV_TEST_DIR}/bin/pyenv-which"
|
||||||
|
echo "echo /bin/python" >"${PYENV_TEST_DIR}/bin/pyenv-which"
|
||||||
|
chmod +x "${PYENV_TEST_DIR}/bin/pyenv-which"
|
||||||
|
PYENV_VERSION="system" run pyenv-prefix
|
||||||
|
assert_success "/"
|
||||||
|
}
|
||||||
|
|
||||||
@test "prefix for invalid system" {
|
@test "prefix for invalid system" {
|
||||||
PATH="$(path_without python)" run pyenv-prefix system
|
PATH="$(path_without python)" run pyenv-prefix system
|
||||||
assert_failure "pyenv: system version not found in PATH"
|
assert_failure "pyenv: system version not found in PATH"
|
||||||
|
|
|
@ -20,10 +20,10 @@ if [ -z "$PYENV_TEST_DIR" ]; then
|
||||||
export PYENV_HOOK_PATH="${PYENV_ROOT}/pyenv.d"
|
export PYENV_HOOK_PATH="${PYENV_ROOT}/pyenv.d"
|
||||||
|
|
||||||
PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
|
PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
|
||||||
PATH="${PYENV_TEST_DIR}/bin:$PATH"
|
|
||||||
PATH="${BATS_TEST_DIRNAME}/../libexec:$PATH"
|
PATH="${BATS_TEST_DIRNAME}/../libexec:$PATH"
|
||||||
PATH="${BATS_TEST_DIRNAME}/libexec:$PATH"
|
PATH="${BATS_TEST_DIRNAME}/libexec:$PATH"
|
||||||
PATH="${PYENV_ROOT}/shims:$PATH"
|
PATH="${PYENV_ROOT}/shims:$PATH"
|
||||||
|
PATH="${PYENV_TEST_DIR}/bin:$PATH"
|
||||||
export PATH
|
export PATH
|
||||||
|
|
||||||
for xdg_var in `env 2>/dev/null | grep ^XDG_ | cut -d= -f1`; do unset "$xdg_var"; done
|
for xdg_var in `env 2>/dev/null | grep ^XDG_ | cut -d= -f1`; do unset "$xdg_var"; done
|
||||||
|
|
Loading…
Reference in a new issue