Some checks are pending
macos_build / macos_build (3.10) (push) Waiting to run
macos_build / macos_build (3.11) (push) Waiting to run
macos_build / macos_build (3.12) (push) Waiting to run
macos_build / macos_build (3.13) (push) Waiting to run
macos_build / macos_build (3.14) (push) Waiting to run
pyenv_tests / pyenv_tests (macos-14) (push) Waiting to run
pyenv_tests / pyenv_tests (macos-15) (push) Waiting to run
pyenv_tests / pyenv_tests (macos-15-intel) (push) Waiting to run
pyenv_tests / pyenv_tests (macos-26) (push) Waiting to run
pyenv_tests / pyenv_tests (ubuntu-22.04) (push) Waiting to run
pyenv_tests / pyenv_tests (ubuntu-24.04) (push) Waiting to run
ubuntu_build / ubuntu_build (3.10) (push) Waiting to run
ubuntu_build / ubuntu_build (3.11) (push) Waiting to run
ubuntu_build / ubuntu_build (3.12) (push) Waiting to run
ubuntu_build / ubuntu_build (3.13) (push) Waiting to run
ubuntu_build / ubuntu_build (3.14) (push) Waiting to run
39 lines
1.0 KiB
Bash
39 lines
1.0 KiB
Bash
#!/usr/bin/env bats
|
|
|
|
load test_helper
|
|
|
|
python_build_bin="${BATS_TEST_DIRNAME}/../bin/python-build"
|
|
static_version="$(grep VERSION "$python_build_bin" | head -n1 | cut -d'"' -f 2)"
|
|
|
|
@test "python-build static version" {
|
|
stub git 'echo "ASPLODE" >&2; exit 1'
|
|
run python-build --version
|
|
assert_success "python-build ${static_version}"
|
|
unstub git
|
|
}
|
|
|
|
@test "python-build git version" {
|
|
stub git \
|
|
'remote -v : echo origin https://github.com/pyenv/pyenv.git' \
|
|
"describe --tags HEAD : echo v1984-12-gSHA"
|
|
run python-build --version
|
|
assert_success "python-build 1984-12-gSHA"
|
|
unstub git
|
|
}
|
|
|
|
@test "git describe fails" {
|
|
stub git \
|
|
'remote -v : echo origin https://github.com/pyenv/pyenv.git' \
|
|
"describe --tags HEAD : echo ASPLODE >&2; exit 1"
|
|
run python-build --version
|
|
assert_success "python-build ${static_version}"
|
|
unstub git
|
|
}
|
|
|
|
@test "git remote doesn't match" {
|
|
stub git \
|
|
'remote -v : echo origin https://github.com/Homebrew/homebrew.git'
|
|
run python-build --version
|
|
assert_success "python-build ${static_version}"
|
|
}
|