(t *testing.T)
| 22 | } |
| 23 | |
| 24 | func 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 | |
| 50 | func TestRCInvalidPod(t *testing.T) { |
| 51 | kubeRC := testNewKubeRC(kube.ObjectMeta{Name: "invalid-pod"}, nil, &kube.Pod{}) |
nothing calls this directly
no test coverage detected