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

Function TestRCNoPod

pkg/entity/replicationcontroller_test.go:24–48  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

22}
23
24func TestRCNoPod(t *testing.T) {
25 kubeRC := kube.ReplicationController{
26 ObjectMeta: kube.ObjectMeta{
27 Name: "no-pod",
28 },
29 Spec: kube.ReplicationControllerSpec{
30 Selector: map[string]string{"service": "jams"},
31 Template: nil,
32 },
33 }
34
35 rc, err := NewReplicationController(&kubeRC, kube.ObjectMeta{}, "")
36 assert.NoError(t, err)
37
38 // internals
39 assert.Nil(t, rc.pod, "pod should be nil")
40
41 // images
42 images := rc.Images()
43 assert.Len(t, images, 0, "no image should have been created")
44
45 // deployment
46 _, err = rc.Deployment()
47 assert.Error(t, err, "does not have pod, cannot deploy")
48}
49
50func TestRCInvalidPod(t *testing.T) {
51 kubeRC := testNewKubeRC(kube.ObjectMeta{Name: "invalid-pod"}, nil, &kube.Pod{})

Callers

nothing calls this directly

Calls 4

ImagesMethod · 0.95
DeploymentMethod · 0.95
NewReplicationControllerFunction · 0.85
LenMethod · 0.45

Tested by

no test coverage detected