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

Function TestPodNoImage

pkg/entity/pod_test.go:45–62  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

43}
44
45func TestPodNoImage(t *testing.T) {
46 kubePod := testNewKubePod("no-image-pod")
47 kubePod.Spec.Containers = []kube.Container{
48 {
49 Name: "no-image",
50 ImagePullPolicy: kube.PullIfNotPresent,
51 },
52 }
53
54 pod, err := NewPod(kubePod, kube.ObjectMeta{}, "")
55 assert.NoError(t, err, "imageless but valid pod")
56
57 _, _, err = pod.data()
58 assert.Error(t, err, "kube not possible without image")
59
60 _, err = pod.Deployment()
61 assert.Error(t, err, "deployment not possible without image")
62}
63
64func TestPodWithContainersImage(t *testing.T) {
65 pod, err := NewPod(testCreateKubePodSourcegraph("test"), kube.ObjectMeta{}, "has-containers")

Callers

nothing calls this directly

Calls 4

dataMethod · 0.95
DeploymentMethod · 0.95
testNewKubePodFunction · 0.85
NewPodFunction · 0.85

Tested by

no test coverage detected