Convert plugins to accept bytes instead of unstruct.

This commit is contained in:
Jeffrey Regan
2019-05-07 17:54:02 -07:00
committed by jregan
parent 06acd3caa9
commit 2e71a3b862
14 changed files with 109 additions and 96 deletions

View File

@@ -54,6 +54,21 @@ var testDeployment = factory.FromMap(
const deploymentAsString = `{"apiVersion":"apps/v1","kind":"Deployment","metadata":{"name":"pooh"}}`
func TestAsYAML(t *testing.T) {
expected := `apiVersion: apps/v1
kind: Deployment
metadata:
name: pooh
`
yaml, err := testDeployment.AsYAML()
if err != nil {
t.Fatal(err)
}
if string(yaml) != expected {
t.Fatalf("--- expected\n%s\n--- got\n%s\n", expected, string(yaml))
}
}
func TestResourceString(t *testing.T) {
tests := []struct {
in *Resource