(t *testing.T)
| 94 | } |
| 95 | |
| 96 | func 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 | |
| 117 | func TestUserAgent(t *testing.T) { |
| 118 | clusters := make(map[string]*api.Cluster) |
nothing calls this directly
no test coverage detected