fixed install behavior and added local ai configuration pathway

This commit is contained in:
2026-06-11 11:17:56 -05:00
parent 79615dd529
commit d19d7efefc
8 changed files with 411 additions and 20 deletions
+40
View File
@@ -127,3 +127,43 @@ func TestRunMainMacos(t *testing.T) {
t.Error("expected program to complete successfully on macOS mock run")
}
}
func TestRunMainLocalAIValidation(t *testing.T) {
defer resetMocks()
// 1. macOS validation
isMacOS = true
pkgMgr = "brew"
var exited bool
var exitCode int
osExit = func(code int) {
exited = true
exitCode = code
}
runMain([]string{"bootstrap_environment", "--local-ai"})
if !exited {
t.Error("expected runMain with --local-ai on macOS to exit")
}
if exitCode != 1 {
t.Errorf("expected exit code 1, got %d", exitCode)
}
// 2. Linux non-apt validation
resetMocks()
isMacOS = false
pkgMgr = "dnf"
exited = false
osExit = func(code int) {
exited = true
exitCode = code
}
runMain([]string{"bootstrap_environment", "--local-ai"})
if !exited {
t.Error("expected runMain with --local-ai on Fedora/dnf to exit")
}
if exitCode != 1 {
t.Errorf("expected exit code 1, got %d", exitCode)
}
}