mirror of
https://github.com/pyenv/pyenv.git
synced 2026-08-04 03:20:35 +09:00
Adapt tests involving current directory for Docker
In Docker CI tests, the default current dir is read-only
This commit is contained in:
parent
95df7dbc7b
commit
74c6efe2f4
@ -17,7 +17,7 @@ load test_helper
|
|||||||
}
|
}
|
||||||
|
|
||||||
@test "version with glob characters is handled correctly" {
|
@test "version with glob characters is handled correctly" {
|
||||||
touch 1.1
|
cd "$BATS_TEST_TMPDIR"; touch 1.1
|
||||||
mkdir -p "$PYENV_ROOT"
|
mkdir -p "$PYENV_ROOT"
|
||||||
echo "[1-9].?*" > "$PYENV_ROOT/version"
|
echo "[1-9].?*" > "$PYENV_ROOT/version"
|
||||||
run pyenv-global
|
run pyenv-global
|
||||||
|
|||||||
@ -20,7 +20,7 @@ _setup() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@test "version with glob characters is handled correctly" {
|
@test "version with glob characters is handled correctly" {
|
||||||
touch 1.1
|
cd "$BATS_TEST_TMPDIR"; touch 1.1
|
||||||
echo "[1-9].?*" > .python-version
|
echo "[1-9].?*" > .python-version
|
||||||
run pyenv-local
|
run pyenv-local
|
||||||
assert_success "[1-9].?*"
|
assert_success "[1-9].?*"
|
||||||
|
|||||||
@ -17,7 +17,7 @@ load test_helper
|
|||||||
}
|
}
|
||||||
|
|
||||||
@test "version with glob characters is handled correctly" {
|
@test "version with glob characters is handled correctly" {
|
||||||
touch 1.1
|
cd "$BATS_TEST_TMPDIR"; touch 1.1
|
||||||
PYENV_VERSION="[1-9].?*" run pyenv-prefix
|
PYENV_VERSION="[1-9].?*" run pyenv-prefix
|
||||||
assert_failure "pyenv: version \`[1-9].?*' not installed"
|
assert_failure "pyenv: version \`[1-9].?*' not installed"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -23,7 +23,7 @@ _setup() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@test "version with glob characters is handled correctly" {
|
@test "version with glob characters is handled correctly" {
|
||||||
touch 1.1
|
cd "$BATS_TEST_TMPDIR"; touch 1.1
|
||||||
PYENV_VERSION="[1-9].?*" run pyenv-version-name
|
PYENV_VERSION="[1-9].?*" run pyenv-version-name
|
||||||
assert_failure <<'!'
|
assert_failure <<'!'
|
||||||
pyenv: version `[1-9].?*' is not installed (set by PYENV_VERSION environment variable)
|
pyenv: version `[1-9].?*' is not installed (set by PYENV_VERSION environment variable)
|
||||||
|
|||||||
@ -81,7 +81,7 @@ OUT
|
|||||||
}
|
}
|
||||||
|
|
||||||
@test "version with glob characters is handled correctly" {
|
@test "version with glob characters is handled correctly" {
|
||||||
touch 1.1
|
cd "$BATS_TEST_TMPDIR"; touch 1.1
|
||||||
PYENV_VERSION="[1-9].?*" run pyenv-version
|
PYENV_VERSION="[1-9].?*" run pyenv-version
|
||||||
assert_failure
|
assert_failure
|
||||||
assert_output <<OUT
|
assert_output <<OUT
|
||||||
|
|||||||
@ -66,7 +66,7 @@ OUT
|
|||||||
@test "version with glob characters is handled correctly" {
|
@test "version with glob characters is handled correctly" {
|
||||||
stub_system_python
|
stub_system_python
|
||||||
create_version "[1-9].?*"
|
create_version "[1-9].?*"
|
||||||
touch 1.1
|
cd "$BATS_TEST_TMPDIR"; touch 1.1
|
||||||
run pyenv-versions
|
run pyenv-versions
|
||||||
assert_success
|
assert_success
|
||||||
assert_output <<OUT
|
assert_output <<OUT
|
||||||
|
|||||||
@ -92,7 +92,7 @@ OUT
|
|||||||
|
|
||||||
@test "version with glob characters is handled correctly" {
|
@test "version with glob characters is handled correctly" {
|
||||||
bats_require_minimum_version 1.5.0
|
bats_require_minimum_version 1.5.0
|
||||||
touch 1.1
|
cd "$BATS_TEST_TMPDIR"; touch 1.1
|
||||||
PATH="$(path_without foo)" PYENV_VERSION="[1-9].?*" run -127 pyenv-which foo
|
PATH="$(path_without foo)" PYENV_VERSION="[1-9].?*" run -127 pyenv-which foo
|
||||||
assert_failure
|
assert_failure
|
||||||
assert_output <<!
|
assert_output <<!
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user