MCPcopy Index your code
hub / github.com/devspace-sh/devspace / TestGetPodStatus

Function TestGetPodStatus

pkg/devspace/kubectl/client_test.go:96–115  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

94}
95
96func TestGetPodStatus(t *testing.T) {
97 // Create the fake client.
98 kubeClient := fake.NewSimpleClientset()
99
100 // Inject an event into the fake client.
101 err := createTestResources(kubeClient)
102 if err != nil {
103 t.Fatal(err)
104 }
105
106 podList, err := kubeClient.CoreV1().Pods(testNamespace).List(context.TODO(), metav1.ListOptions{})
107 if err != nil {
108 t.Fatalf("error retrieving list: %v", err)
109 }
110
111 status := GetPodStatus(&podList.Items[0])
112 if status != "Running" {
113 t.Fatalf("Unexpected status: %s", status)
114 }
115}
116
117func TestUserAgent(t *testing.T) {
118 clusters := make(map[string]*api.Cluster)

Callers

nothing calls this directly

Calls 5

createTestResourcesFunction · 0.85
GetPodStatusFunction · 0.70
ListMethod · 0.65
FatalMethod · 0.45
FatalfMethod · 0.45

Tested by

no test coverage detected