MCPcopy
hub / github.com/redspread/spread / TestBaseNoDefaultAnnotationsAndLabels

Function TestBaseNoDefaultAnnotationsAndLabels

pkg/entity/entity_test.go:142–159  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

140}
141
142func TestBaseNoDefaultAnnotationsAndLabels(t *testing.T) {
143 defaults := kube.ObjectMeta{}
144 obj := createSecret("postgres")
145 obj.Annotations = map[string]string{"object": "data"}
146 obj.Labels = map[string]string{"data": "object"}
147
148 base, err := newBase(EntityContainer, defaults, "src", []deploy.KubeObject{obj})
149 assert.NoError(t, err)
150
151 objects := base.Objects()
152 assert.Len(t, objects, 1)
153
154 expected := obj
155 actual := objects[0]
156
157 assert.Equal(t, expected.Annotations, actual.GetObjectMeta().GetAnnotations())
158 assert.Equal(t, expected.Labels, actual.GetObjectMeta().GetLabels())
159}
160
161func TestBaseCheckAttach(t *testing.T) {
162 baseImage := newDockerImage(t, "sample-image")

Callers

nothing calls this directly

Calls 5

newBaseFunction · 0.85
createSecretFunction · 0.70
ObjectsMethod · 0.65
LenMethod · 0.45
EqualMethod · 0.45

Tested by

no test coverage detected