MCPcopy Create free account
hub / github.com/Thunder-Compute/thunder-cli / TestRunUpdateCommand_SelfUpdateDisabled

Function TestRunUpdateCommand_SelfUpdateDisabled

cmd/update_test.go:15–25  ·  view source on GitHub ↗

TestRunUpdateCommand_SelfUpdateDisabled verifies that the update command returns an error when TNR_NO_SELFUPDATE environment variable is set.

(t *testing.T)

Source from the content-addressed store, hash-verified

13// TestRunUpdateCommand_SelfUpdateDisabled verifies that the update command
14// returns an error when TNR_NO_SELFUPDATE environment variable is set.
15func TestRunUpdateCommand_SelfUpdateDisabled(t *testing.T) {
16 originalEnv := os.Getenv("TNR_NO_SELFUPDATE")
17 defer os.Setenv("TNR_NO_SELFUPDATE", originalEnv)
18
19 os.Setenv("TNR_NO_SELFUPDATE", "1")
20
21 err := runUpdateCommand()
22 assert.Error(t, err)
23 assert.Contains(t, err.Error(), "self-update is disabled")
24 assert.Contains(t, err.Error(), "TNR_NO_SELFUPDATE=1")
25}
26
27// TestHandlePMUpdate_Homebrew verifies that handlePMUpdate prints correct
28// instructions for Homebrew-managed installations.

Callers

nothing calls this directly

Calls 2

runUpdateCommandFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected