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

Function TestCheckForUpdate_APIError

internal/update/update_test.go:123–133  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

121}
122
123func TestCheckForUpdate_APIError(t *testing.T) {
124 srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
125 w.WriteHeader(http.StatusInternalServerError)
126 }))
127 defer srv.Close()
128
129 _, err := CheckForUpdate("0.5.0", Options{ReleasesURL: srv.URL})
130 if err == nil {
131 t.Error("expected error for API failure")
132 }
133}
134
135func TestCheckForUpdate_BadJSON(t *testing.T) {
136 srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {

Callers

nothing calls this directly

Calls 1

CheckForUpdateFunction · 0.85

Tested by

no test coverage detected