mirror of
https://github.com/pyenv/pyenv-virtualenv.git
synced 2025-11-16 23:43:44 -05:00
Display the version of pyvenv if USE_PYVENV is set
This commit is contained in:
37
test/version.bats
Normal file
37
test/version.bats
Normal file
@@ -0,0 +1,37 @@
|
||||
#!/usr/bin/env bats
|
||||
|
||||
load test_helper
|
||||
|
||||
setup() {
|
||||
export PYENV_ROOT="${TMP}/pyenv"
|
||||
export PYENV_VIRTUALENV_VERSION="20140110.1"
|
||||
}
|
||||
|
||||
@test "display virtualenv version" {
|
||||
stub pyenv-which "virtualenv : true"
|
||||
stub pyenv-which "pyvenv : true"
|
||||
stub pyenv-exec "virtualenv --version : echo \"1.11\""
|
||||
|
||||
run pyenv-virtualenv --version
|
||||
|
||||
unstub pyenv-which
|
||||
unstub pyenv-exec
|
||||
|
||||
assert_success
|
||||
assert_output "pyenv-virtualenv ${PYENV_VIRTUALENV_VERSION} (virtualenv 1.11)"
|
||||
}
|
||||
|
||||
@test "display pyvenv version" {
|
||||
stub pyenv-which "virtualenv : false"
|
||||
stub pyenv-which "pyvenv : echo \"${PYENV_ROOT}/versions/3.3.3/bin/pyvenv\""
|
||||
stub pyenv-which "pyvenv : echo \"${PYENV_ROOT}/versions/3.3.3/bin/pyvenv\""
|
||||
stub pyenv-root "echo \"${PYENV_ROOT}\""
|
||||
|
||||
run pyenv-virtualenv --version
|
||||
|
||||
unstub pyenv-which
|
||||
unstub pyenv-root
|
||||
|
||||
assert_success
|
||||
assert_output "pyenv-virtualenv ${PYENV_VIRTUALENV_VERSION} (pyvenv 3.3.3)"
|
||||
}
|
||||
Reference in New Issue
Block a user