(t *testing.T)
| 176 | } |
| 177 | |
| 178 | func TestLoadingEmptyMaps(t *testing.T) { |
| 179 | configFile, _ := ioutil.TempFile("", "") |
| 180 | defer os.Remove(configFile.Name()) |
| 181 | |
| 182 | mockConfig := clientcmdapi.Config{ |
| 183 | CurrentContext: "any-context-value", |
| 184 | } |
| 185 | |
| 186 | WriteToFile(mockConfig, configFile.Name()) |
| 187 | |
| 188 | config, err := LoadFromFile(configFile.Name()) |
| 189 | if err != nil { |
| 190 | t.Errorf("Unexpected error: %v", err) |
| 191 | } |
| 192 | |
| 193 | if config.Clusters == nil { |
| 194 | t.Error("expected config.Clusters to be non-nil") |
| 195 | } |
| 196 | if config.AuthInfos == nil { |
| 197 | t.Error("expected config.AuthInfos to be non-nil") |
| 198 | } |
| 199 | if config.Contexts == nil { |
| 200 | t.Error("expected config.Contexts to be non-nil") |
| 201 | } |
| 202 | } |
| 203 | |
| 204 | func TestDuplicateClusterName(t *testing.T) { |
| 205 | configFile, _ := ioutil.TempFile("", "") |
nothing calls this directly
no test coverage detected