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

Function TestCheckVersionForServe_NoUpdate

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

Source from the content-addressed store, hash-verified

60}
61
62func TestCheckVersionForServe_NoUpdate(t *testing.T) {
63 release := update.Release{TagName: "v0.5.0"}
64 srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
65 json.NewEncoder(w).Encode(release)
66 }))
67 defer srv.Close()
68
69 result := CheckVersionForServe("0.5.0", srv.URL)
70 if result == nil {
71 t.Fatal("expected non-nil result")
72 }
73 if result.UpdateAvailable {
74 t.Error("expected no update available")
75 }
76}
77
78func TestCheckVersionForServe_APIFailure(t *testing.T) {
79 srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {

Callers

nothing calls this directly

Calls 1

CheckVersionForServeFunction · 0.85

Tested by

no test coverage detected