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

Function TestBaseNew

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

Source from the content-addressed store, hash-verified

18}
19
20func TestBaseNew(t *testing.T) {
21 entityType := Type(rand.Intn(5))
22 source := randomString(8)
23 var objects []deploy.KubeObject
24
25 base, err := newBase(entityType, kube.ObjectMeta{}, source, objects)
26 assert.NoError(t, err, "valid entity")
27
28 assert.Equal(t, entityType, base.Type(), "type cannot change")
29 assert.Equal(t, source, base.Source(), "source cannot change")
30
31 emptyDeploy := deploy.Deployment{}
32 assert.True(t, emptyDeploy.Equal(&base.objects))
33}
34
35func TestBaseNilObjects(t *testing.T) {
36 objects := []deploy.KubeObject{

Callers

nothing calls this directly

Calls 7

EqualMethod · 0.95
TypeTypeAlias · 0.85
newBaseFunction · 0.85
randomStringFunction · 0.70
TypeMethod · 0.65
SourceMethod · 0.65
EqualMethod · 0.45

Tested by

no test coverage detected