MCPcopy Create free account
hub / github.com/docker/cli / TestTlsCreateUpdateGetRemove

Function TestTlsCreateUpdateGetRemove

cli/context/store/tlsstore_test.go:10–33  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

8)
9
10func TestTlsCreateUpdateGetRemove(t *testing.T) {
11 testee := tlsStore{root: t.TempDir()}
12
13 const contextName = "test-ctx"
14
15 _, err := testee.getData(contextName, "test-ep", "test-data")
16 assert.ErrorType(t, err, errdefs.IsNotFound)
17
18 err = testee.createOrUpdate(contextName, "test-ep", "test-data", []byte("data"))
19 assert.NilError(t, err)
20 data, err := testee.getData(contextName, "test-ep", "test-data")
21 assert.NilError(t, err)
22 assert.Equal(t, string(data), "data")
23 err = testee.createOrUpdate(contextName, "test-ep", "test-data", []byte("data2"))
24 assert.NilError(t, err)
25 data, err = testee.getData(contextName, "test-ep", "test-data")
26 assert.NilError(t, err)
27 assert.Equal(t, string(data), "data2")
28
29 err = testee.removeEndpoint(contextName, "test-ep")
30 assert.NilError(t, err)
31 _, err = testee.getData(contextName, "test-ep", "test-data")
32 assert.ErrorType(t, err, errdefs.IsNotFound)
33}
34
35func TestTlsListAndBatchRemove(t *testing.T) {
36 testee := tlsStore{root: t.TempDir()}

Callers

nothing calls this directly

Calls 3

getDataMethod · 0.95
createOrUpdateMethod · 0.95
removeEndpointMethod · 0.95

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…