mirror of
https://github.com/pyenv/pyenv-virtualenv.git
synced 2025-11-14 14:33:52 -05:00
Prevent removing symlinks bound to different version (#106)
This commit is contained in:
@@ -54,6 +54,23 @@ setup() {
|
||||
[ ! -L "${PYENV_ROOT}/versions/venv27" ]
|
||||
}
|
||||
|
||||
@test "not delete virtualenv with different symlink" {
|
||||
mkdir -p "${PYENV_ROOT}/versions/2.7.8/envs/venv27"
|
||||
mkdir -p "${PYENV_ROOT}/versions/2.7.10/envs/venv27"
|
||||
ln -fs "${PYENV_ROOT}/versions/2.7.8/envs/venv27" "${PYENV_ROOT}/versions/venv27"
|
||||
|
||||
stub pyenv-rehash "true"
|
||||
|
||||
run pyenv-virtualenv-delete -f "2.7.10/envs/venv27"
|
||||
|
||||
assert_success
|
||||
|
||||
unstub pyenv-rehash
|
||||
|
||||
[ ! -d "${PYENV_ROOT}/versions/2.7.10/envs/venv27" ]
|
||||
[ -L "${PYENV_ROOT}/versions/venv27" ]
|
||||
}
|
||||
|
||||
@test "not delete virtualenv with same name" {
|
||||
mkdir -p "${PYENV_ROOT}/versions/2.7.10/envs/venv27"
|
||||
mkdir -p "${PYENV_ROOT}/versions/venv27"
|
||||
|
||||
Reference in New Issue
Block a user