forked from pyenv/pyenv-virtualenv
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathversion.bats
39 lines (29 loc) · 917 Bytes
/
version.bats
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/bin/env bats
load test_helper
setup() {
export PYENV_ROOT="${TMP}/pyenv"
}
@test "display virtualenv version" {
setup_virtualenv "2.7.7"
stub pyenv-prefix "echo '${PYENV_ROOT}/versions/2.7.7'"
stub pyenv-version-name "echo 2.7.7"
stub pyenv-exec "python -m venv --help : false"
stub pyenv-exec "virtualenv --version : echo \"1.11\""
run pyenv-virtualenv --version
assert_success
[[ "$output" == "pyenv-virtualenv "?.?.?" (virtualenv 1.11)" ]]
unstub pyenv-prefix
unstub pyenv-exec
teardown_virtualenv "2.7.7"
}
@test "display venv version" {
setup_m_venv "3.4.1"
stub pyenv-version-name "echo 3.4.1"
stub pyenv-prefix "echo '${PYENV_ROOT}/versions/3.4.1'"
stub pyenv-exec "python -m venv --help : true"
run pyenv-virtualenv --version
assert_success
[[ "$output" == "pyenv-virtualenv "?.?.?" (python -m venv)" ]]
unstub pyenv-prefix
teardown_m_venv "3.4.1"
}