2023-11-15 12:12:28 +01:00
|
|
|
Import-Module "$PSScriptRoot/../helpers/Common.Helpers.psm1"
|
2023-11-28 02:25:03 +01:00
|
|
|
Import-Module "$PSScriptRoot/Helpers.psm1" -DisableNameChecking
|
2023-11-15 12:12:28 +01:00
|
|
|
|
|
|
|
|
$os = Get-OSVersion
|
|
|
|
|
|
2024-03-18 18:34:52 +01:00
|
|
|
Describe "Python3" {
|
2023-11-15 12:12:28 +01:00
|
|
|
It "Python 3 is available" {
|
|
|
|
|
"python3 --version" | Should -ReturnZeroExitCode
|
|
|
|
|
}
|
2024-03-18 18:34:52 +01:00
|
|
|
|
2025-09-11 23:49:57 +02:00
|
|
|
if ($os.IsArm64) {
|
2024-03-18 18:34:52 +01:00
|
|
|
It "Python 3 is installed under /opt/homebrew/bin/" {
|
|
|
|
|
Get-ToolPath "python3" | Should -BeLike "/opt/homebrew/bin/*"
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
It "Python 3 is installed under /usr/local/bin" {
|
2025-10-10 17:19:38 +02:00
|
|
|
Get-ToolPath "python3" | Should -BeLike "/usr/local/bin/*"
|
2024-03-18 18:34:52 +01:00
|
|
|
}
|
2023-11-15 12:12:28 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
It "Pip 3 is available" {
|
|
|
|
|
"pip3 --version" | Should -ReturnZeroExitCode
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
It "Pipx is available" {
|
|
|
|
|
"pipx --version" | Should -ReturnZeroExitCode
|
|
|
|
|
}
|
|
|
|
|
|
2025-10-16 12:34:30 +02:00
|
|
|
It "Pip 3 and Python 3 came from the same path prefix" {
|
2023-11-15 12:12:28 +01:00
|
|
|
$pip3Path = Split-Path (readlink (which pip3))
|
|
|
|
|
$python3Path = Split-Path (readlink (which python3))
|
|
|
|
|
$pip3Path | Should -BeExactly $python3Path
|
|
|
|
|
}
|
|
|
|
|
|
2025-10-16 12:34:30 +02:00
|
|
|
It "Pip 3 and Python 3 came from brew formula" {
|
|
|
|
|
Split-Path (readlink (which pip3)) | Should -BeLike "*/Cellar/*"
|
|
|
|
|
Split-Path (readlink (which python3)) | Should -BeLike "*/Cellar/*"
|
|
|
|
|
}
|
|
|
|
|
|
2023-11-15 12:12:28 +01:00
|
|
|
}
|