MCPcopy
hub / github.com/caddyserver/certmagic / TestRenewLockLeaseWithoutInterface

Function TestRenewLockLeaseWithoutInterface

config_test.go:137–148  ·  view source on GitHub ↗

Test that no error occurs when storage doesn't support lease renewal

(t *testing.T)

Source from the content-addressed store, hash-verified

135
136// Test that no error occurs when storage doesn't support lease renewal
137func TestRenewLockLeaseWithoutInterface(t *testing.T) {
138 ctx := context.Background()
139 tmpDir, err := os.MkdirTemp(os.TempDir(), "certmagic-test*")
140 testutil.RequireNoError(t, err, "allocating tmp dir")
141 defer os.RemoveAll(tmpDir)
142
143 storage := &FileStorage{Path: tmpDir}
144
145 cfg := &Config{Logger: defaultTestLogger}
146 err = cfg.renewLockLease(ctx, storage, "test-lock", 0)
147 testutil.RequireNoError(t, err)
148}
149
150func mustJSON(val any) []byte {
151 result, err := json.Marshal(val)

Callers

nothing calls this directly

Calls 2

renewLockLeaseMethod · 0.95
RequireNoErrorFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…