Пример #1
0
func TestUnstructuredListSetters(t *testing.T) {
	unstruct := runtime.UnstructuredList{}

	want := runtime.UnstructuredList{
		Object: map[string]interface{}{
			"kind":       "test_kind",
			"apiVersion": "test_version",
			"metadata": map[string]interface{}{
				"resourceVersion": "test_resourceVersion",
				"selfLink":        "test_selfLink",
			},
		},
	}

	unstruct.SetAPIVersion("test_version")
	unstruct.SetKind("test_kind")
	unstruct.SetResourceVersion("test_resourceVersion")
	unstruct.SetSelfLink("test_selfLink")

	if !reflect.DeepEqual(unstruct, want) {
		t.Errorf("Wanted: \n%s\n Got:\n%s", unstruct, want)
	}
}