You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
1.0 KiB

  1. #!/usr/bin/env bats
  2. load test_helper
  3. setup() {
  4. export PYENV_ROOT="${TMP}/pyenv"
  5. }
  6. @test "display virtualenv version" {
  7. setup_virtualenv "2.7.7"
  8. stub pyenv-prefix "echo '${PYENV_ROOT}/versions/2.7.7'"
  9. stub pyenv-version-name "echo 2.7.7"
  10. stub pyenv-exec "python2.7 -m venv --help : false"
  11. stub pyenv-exec "python2 -m venv --help : false"
  12. stub pyenv-exec "python -m venv --help : false"
  13. stub pyenv-exec "virtualenv --version : echo \"1.11\""
  14. run pyenv-virtualenv --version
  15. assert_success
  16. [[ "$output" == "pyenv-virtualenv "?.?.?" (virtualenv 1.11)" ]]
  17. unstub pyenv-prefix
  18. unstub pyenv-exec
  19. teardown_virtualenv "2.7.7"
  20. }
  21. @test "display venv version" {
  22. setup_m_venv "3.4.1"
  23. stub pyenv-version-name "echo 3.4.1"
  24. stub pyenv-prefix "echo '${PYENV_ROOT}/versions/3.4.1'"
  25. stub pyenv-exec "python3.4 -m venv --help : true"
  26. run pyenv-virtualenv --version
  27. assert_success
  28. [[ "$output" == "pyenv-virtualenv "?.?.?" (python3.4 -m venv)" ]]
  29. unstub pyenv-prefix
  30. teardown_m_venv "3.4.1"
  31. }