MCPcopy Index your code
hub / github.com/docker/cli / TestErrCreateDefault

Function TestErrCreateDefault

cli/command/defaultcontextstore_test.go:151–163  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

149}
150
151func TestErrCreateDefault(t *testing.T) {
152 meta := testDefaultMetadata()
153 s := testStore(t, meta, store.ContextTLSData{})
154 err := s.CreateOrUpdate(store.Metadata{
155 Endpoints: map[string]any{
156 "ep1": endpoint{Foo: "bar"},
157 },
158 Metadata: testContext{Bar: "baz"},
159 Name: "default",
160 })
161 assert.Check(t, is.ErrorType(err, errdefs.IsInvalidArgument))
162 assert.Error(t, err, "default context cannot be created nor updated")
163}
164
165func TestErrRemoveDefault(t *testing.T) {
166 meta := testDefaultMetadata()

Callers

nothing calls this directly

Calls 4

testDefaultMetadataFunction · 0.85
testStoreFunction · 0.85
CreateOrUpdateMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…