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

Function TestVerifyChecksum_Mismatch

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

Source from the content-addressed store, hash-verified

338}
339
340func TestVerifyChecksum_Mismatch(t *testing.T) {
341 dir := t.TempDir()
342 filePath := filepath.Join(dir, "binary")
343 os.WriteFile(filePath, []byte("content"), 0o644)
344
345 srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
346 fmt.Fprintf(w, "0000000000000000000000000000000000000000000000000000000000000000 binary\n")
347 }))
348 defer srv.Close()
349
350 if err := verifyChecksum(filePath, srv.URL); err == nil {
351 t.Error("expected checksum verification to fail")
352 }
353}
354
355func TestPerformUpdate_AlreadyLatest(t *testing.T) {
356 release := Release{TagName: "v0.5.0"}

Callers

nothing calls this directly

Calls 1

verifyChecksumFunction · 0.85

Tested by

no test coverage detected