MCPcopy Create free account
hub / github.com/MiniCodeMonkey/chief / TestRunUpdate_APIError

Function TestRunUpdate_APIError

internal/cmd/update_test.go:28–41  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

26}
27
28func TestRunUpdate_APIError(t *testing.T) {
29 srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
30 w.WriteHeader(http.StatusInternalServerError)
31 }))
32 defer srv.Close()
33
34 err := RunUpdate(UpdateOptions{
35 Version: "0.5.0",
36 ReleasesURL: srv.URL,
37 })
38 if err == nil {
39 t.Error("expected error for API failure")
40 }
41}
42
43func TestCheckVersionForServe_UpdateAvailable(t *testing.T) {
44 release := update.Release{TagName: "v0.6.0"}

Callers

nothing calls this directly

Calls 1

RunUpdateFunction · 0.85

Tested by

no test coverage detected