|
|
@ -23,16 +23,18 @@ setup() { |
|
|
|
stub pyenv-version-name "echo venv" |
|
|
|
stub pyenv-virtualenv-prefix "venv : echo \"${PYENV_ROOT}/versions/venv\"" |
|
|
|
stub pyenv-prefix "venv : echo \"${PYENV_ROOT}/versions/venv\"" |
|
|
|
stub pyenv-sh-deactivate "--force --quiet : echo deactivated" |
|
|
|
|
|
|
|
PYENV_SHELL="bash" PYENV_VERSION="venv" run pyenv-sh-activate |
|
|
|
|
|
|
|
unstub pyenv-version-name |
|
|
|
unstub pyenv-virtualenv-prefix |
|
|
|
unstub pyenv-prefix |
|
|
|
stub pyenv-sh-deactivate |
|
|
|
|
|
|
|
assert_success |
|
|
|
assert_output <<EOS |
|
|
|
false |
|
|
|
deactivated |
|
|
|
pyenv-virtualenv: activate venv |
|
|
|
export VIRTUAL_ENV="${PYENV_ROOT}/versions/venv"; |
|
|
|
pyenv-virtualenv: prompt changing will be removed from future release. configure \`export PYENV_VIRTUALENV_DISABLE_PROMPT=1' to simulate the behavior. |
|
|
@ -47,16 +49,18 @@ EOS |
|
|
|
stub pyenv-version-name "echo venv" |
|
|
|
stub pyenv-virtualenv-prefix "venv : echo \"${PYENV_ROOT}/versions/venv\"" |
|
|
|
stub pyenv-prefix "venv : echo \"${PYENV_ROOT}/versions/venv\"" |
|
|
|
stub pyenv-sh-deactivate "--force --quiet --verbose : echo deactivated" |
|
|
|
|
|
|
|
PYENV_SHELL="bash" PYENV_VERSION="venv" run pyenv-sh-activate --verbose |
|
|
|
|
|
|
|
unstub pyenv-version-name |
|
|
|
unstub pyenv-virtualenv-prefix |
|
|
|
unstub pyenv-prefix |
|
|
|
unstub pyenv-sh-deactivate |
|
|
|
|
|
|
|
assert_success |
|
|
|
assert_output <<EOS |
|
|
|
false |
|
|
|
deactivated |
|
|
|
pyenv-virtualenv: activate venv |
|
|
|
export VIRTUAL_ENV="${PYENV_ROOT}/versions/venv"; |
|
|
|
pyenv-virtualenv: prompt changing will be removed from future release. configure \`export PYENV_VIRTUALENV_DISABLE_PROMPT=1' to simulate the behavior. |
|
|
@ -71,12 +75,14 @@ EOS |
|
|
|
stub pyenv-version-name "echo venv" |
|
|
|
stub pyenv-virtualenv-prefix "venv : echo \"${PYENV_ROOT}/versions/venv\"" |
|
|
|
stub pyenv-prefix "venv : echo \"${PYENV_ROOT}/versions/venv\"" |
|
|
|
stub pyenv-sh-deactivate "--force --quiet : echo deactivated" |
|
|
|
|
|
|
|
PYENV_SHELL="bash" PYENV_VERSION="venv" run pyenv-sh-activate |
|
|
|
|
|
|
|
unstub pyenv-version-name |
|
|
|
unstub pyenv-virtualenv-prefix |
|
|
|
unstub pyenv-prefix |
|
|
|
unstub pyenv-sh-deactivate |
|
|
|
|
|
|
|
assert_success |
|
|
|
assert_output <<EOS |
|
|
@ -85,7 +91,7 @@ EOS |
|
|
|
|
|
|
|
eval "\$(pyenv virtualenv-init -)" |
|
|
|
|
|
|
|
false |
|
|
|
deactivated |
|
|
|
pyenv-virtualenv: activate venv |
|
|
|
export PYENV_VERSION="venv"; |
|
|
|
export PYENV_ACTIVATE_SHELL=1; |
|
|
@ -102,16 +108,18 @@ EOS |
|
|
|
stub pyenv-version-name "echo venv" |
|
|
|
stub pyenv-virtualenv-prefix "venv : echo \"${PYENV_ROOT}/versions/venv\"" |
|
|
|
stub pyenv-prefix "venv : echo \"${PYENV_ROOT}/versions/venv\"" |
|
|
|
stub pyenv-sh-deactivate "--force --quiet : echo deactivated" |
|
|
|
|
|
|
|
PYENV_SHELL="fish" PYENV_VERSION="venv" run pyenv-sh-activate |
|
|
|
|
|
|
|
unstub pyenv-version-name |
|
|
|
unstub pyenv-virtualenv-prefix |
|
|
|
unstub pyenv-prefix |
|
|
|
unstub pyenv-sh-deactivate |
|
|
|
|
|
|
|
assert_success |
|
|
|
assert_output <<EOS |
|
|
|
false |
|
|
|
deactivated |
|
|
|
pyenv-virtualenv: activate venv |
|
|
|
setenv VIRTUAL_ENV "${PYENV_ROOT}/versions/venv"; |
|
|
|
pyenv-virtualenv: prompt changing not work for fish. |
|
|
@ -124,12 +132,14 @@ EOS |
|
|
|
stub pyenv-version-name "echo venv" |
|
|
|
stub pyenv-virtualenv-prefix "venv : echo \"${PYENV_ROOT}/versions/venv\"" |
|
|
|
stub pyenv-prefix "venv : echo \"${PYENV_ROOT}/versions/venv\"" |
|
|
|
stub pyenv-sh-deactivate "--force --quiet : echo deactivated" |
|
|
|
|
|
|
|
PYENV_SHELL="fish" PYENV_VERSION="venv" run pyenv-sh-activate |
|
|
|
|
|
|
|
unstub pyenv-version-name |
|
|
|
unstub pyenv-virtualenv-prefix |
|
|
|
unstub pyenv-prefix |
|
|
|
unstub pyenv-sh-deactivate |
|
|
|
|
|
|
|
assert_success |
|
|
|
assert_output <<EOS |
|
|
@ -138,7 +148,7 @@ EOS |
|
|
|
|
|
|
|
status --is-interactive; and . (pyenv virtualenv-init -|psub) |
|
|
|
|
|
|
|
false |
|
|
|
deactivated |
|
|
|
pyenv-virtualenv: activate venv |
|
|
|
setenv PYENV_VERSION "venv"; |
|
|
|
setenv PYENV_ACTIVATE_SHELL 1; |
|
|
@ -152,15 +162,17 @@ EOS |
|
|
|
|
|
|
|
stub pyenv-virtualenv-prefix "venv27 : echo \"${PYENV_ROOT}/versions/venv27\"" |
|
|
|
stub pyenv-prefix "venv27 : echo \"${PYENV_ROOT}/versions/venv27\"" |
|
|
|
stub pyenv-sh-deactivate "--force --quiet : echo deactivated" |
|
|
|
|
|
|
|
PYENV_SHELL="bash" PYENV_VERSION="venv" run pyenv-sh-activate "venv27" |
|
|
|
|
|
|
|
unstub pyenv-virtualenv-prefix |
|
|
|
unstub pyenv-prefix |
|
|
|
unstub pyenv-sh-deactivate |
|
|
|
|
|
|
|
assert_success |
|
|
|
assert_output <<EOS |
|
|
|
false |
|
|
|
deactivated |
|
|
|
pyenv-virtualenv: activate venv27 |
|
|
|
export PYENV_VERSION="venv27"; |
|
|
|
export PYENV_ACTIVATE_SHELL=1; |
|
|
@ -176,11 +188,13 @@ EOS |
|
|
|
|
|
|
|
stub pyenv-virtualenv-prefix "venv27 : echo \"${PYENV_ROOT}/versions/venv27\"" |
|
|
|
stub pyenv-prefix "venv27 : echo \"${PYENV_ROOT}/versions/venv27\"" |
|
|
|
stub pyenv-sh-deactivate "--force --quiet : echo deactivated" |
|
|
|
|
|
|
|
PYENV_SHELL="bash" PYENV_VERSION="venv" run pyenv-sh-activate "venv27" |
|
|
|
|
|
|
|
unstub pyenv-virtualenv-prefix |
|
|
|
unstub pyenv-prefix |
|
|
|
unstub pyenv-sh-deactivate |
|
|
|
|
|
|
|
assert_success |
|
|
|
assert_output <<EOS |
|
|
@ -189,7 +203,7 @@ EOS |
|
|
|
|
|
|
|
eval "\$(pyenv virtualenv-init -)" |
|
|
|
|
|
|
|
false |
|
|
|
deactivated |
|
|
|
pyenv-virtualenv: activate venv27 |
|
|
|
export PYENV_VERSION="venv27"; |
|
|
|
export PYENV_ACTIVATE_SHELL=1; |
|
|
@ -205,15 +219,17 @@ EOS |
|
|
|
|
|
|
|
stub pyenv-virtualenv-prefix "venv27 : echo \"${PYENV_ROOT}/versions/venv27\"" |
|
|
|
stub pyenv-prefix "venv27 : echo \"${PYENV_ROOT}/versions/venv27\"" |
|
|
|
stub pyenv-sh-deactivate "--force --quiet : echo deactivated" |
|
|
|
|
|
|
|
PYENV_SHELL="fish" PYENV_VERSION="venv" run pyenv-sh-activate "venv27" |
|
|
|
|
|
|
|
unstub pyenv-virtualenv-prefix |
|
|
|
unstub pyenv-prefix |
|
|
|
unstub pyenv-sh-deactivate |
|
|
|
|
|
|
|
assert_success |
|
|
|
assert_output <<EOS |
|
|
|
false |
|
|
|
deactivated |
|
|
|
pyenv-virtualenv: activate venv27 |
|
|
|
setenv PYENV_VERSION "venv27"; |
|
|
|
setenv PYENV_ACTIVATE_SHELL 1; |
|
|
@ -227,11 +243,13 @@ EOS |
|
|
|
|
|
|
|
stub pyenv-virtualenv-prefix "venv27 : echo \"${PYENV_ROOT}/versions/venv27\"" |
|
|
|
stub pyenv-prefix "venv27 : echo \"${PYENV_ROOT}/versions/venv27\"" |
|
|
|
stub pyenv-sh-deactivate "--force --quiet : echo deactivated" |
|
|
|
|
|
|
|
PYENV_SHELL="fish" PYENV_VERSION="venv" run pyenv-sh-activate "venv27" |
|
|
|
|
|
|
|
unstub pyenv-virtualenv-prefix |
|
|
|
unstub pyenv-prefix |
|
|
|
unstub pyenv-sh-deactivate |
|
|
|
|
|
|
|
assert_success |
|
|
|
assert_output <<EOS |
|
|
@ -240,7 +258,7 @@ EOS |
|
|
|
|
|
|
|
status --is-interactive; and . (pyenv virtualenv-init -|psub) |
|
|
|
|
|
|
|
false |
|
|
|
deactivated |
|
|
|
pyenv-virtualenv: activate venv27 |
|
|
|
setenv PYENV_VERSION "venv27"; |
|
|
|
setenv PYENV_ACTIVATE_SHELL 1; |
|
|
@ -253,7 +271,7 @@ EOS |
|
|
|
export VIRTUAL_ENV="${PYENV_ROOT}/versions/venv" |
|
|
|
export PYENV_ACTIVATE_SHELL= |
|
|
|
|
|
|
|
stub pyenv-sh-deactivate "echo deactivated" |
|
|
|
stub pyenv-sh-deactivate " : echo deactivated" |
|
|
|
|
|
|
|
run pyenv-sh-activate --unset |
|
|
|
|
|
|
@ -270,8 +288,6 @@ EOS |
|
|
|
|
|
|
|
run pyenv-sh-activate "3.3.3" |
|
|
|
|
|
|
|
unstub pyenv-virtualenv-prefix |
|
|
|
|
|
|
|
assert_failure |
|
|
|
assert_output <<EOS |
|
|
|
pyenv-virtualenv: version \`3.3.3' is not a virtualenv |
|
|
@ -328,8 +344,6 @@ EOS |
|
|
|
|
|
|
|
run pyenv-sh-activate "2.7.10" "venv27" |
|
|
|
|
|
|
|
unstub pyenv-virtualenv-prefix |
|
|
|
|
|
|
|
assert_failure |
|
|
|
assert_output <<EOS |
|
|
|
pyenv-virtualenv: version \`2.7.10' is not a virtualenv |
|
|
@ -340,18 +354,20 @@ EOS |
|
|
|
@test "activate if the first virtualenv is a virtualenv" { |
|
|
|
export PYENV_VIRTUALENV_INIT=1 |
|
|
|
|
|
|
|
stub pyenv-sh-deactivate "--force --quiet : echo deactivated" |
|
|
|
stub pyenv-virtualenv-prefix "venv27 : echo \"${PYENV_ROOT}/versions/venv27\"" |
|
|
|
stub pyenv-virtualenv-prefix "2.7.10 : false" |
|
|
|
stub pyenv-prefix "venv27 : echo \"${PYENV_ROOT}/versions/venv27\"" |
|
|
|
|
|
|
|
run pyenv-sh-activate "venv27" "2.7.10" |
|
|
|
|
|
|
|
unstub pyenv-sh-deactivate |
|
|
|
unstub pyenv-virtualenv-prefix |
|
|
|
unstub pyenv-prefix |
|
|
|
|
|
|
|
assert_success |
|
|
|
assert_output <<EOS |
|
|
|
false |
|
|
|
deactivated |
|
|
|
pyenv-virtualenv: activate venv27 |
|
|
|
export PYENV_VERSION="venv27:2.7.10"; |
|
|
|
export PYENV_ACTIVATE_SHELL=1; |
|
|
|