From 2aa7e30aff82be0a1b81d464db003b5b828d67b5 Mon Sep 17 00:00:00 2001 From: Karen Bradshaw Date: Tue, 14 May 2019 12:35:30 -0400 Subject: [PATCH] minimize test --- .../transformer/patchjson6902json_test.go | 24 ++----------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/pkg/patch/transformer/patchjson6902json_test.go b/pkg/patch/transformer/patchjson6902json_test.go index 7dcefb12c..2c072d854 100644 --- a/pkg/patch/transformer/patchjson6902json_test.go +++ b/pkg/patch/transformer/patchjson6902json_test.go @@ -165,38 +165,18 @@ func TestJsonPatchJSONTransformer_UnHappyTransform(t *testing.T) { } func TestJsonPatchJSONTransformer_EmptyPatchFile(t *testing.T) { - rf := resource.NewFactory( - kunstruct.NewKunstructuredFactoryImpl()) id := resid.NewResId(deploy, "deploy1") - base := resmap.ResMap{ - id: rf.FromMap( - map[string]interface{}{ - "apiVersion": "apps/v1", - "kind": "Deployment", - "metadata": map[string]interface{}{ - "name": "deploy1", - }, - "spec": map[string]interface{}{ - "template": map[string]interface{}{}, - }, - }), - } - operations := []byte(``) - jpt, err := newPatchJson6902JSONTransformer(id, operations) + _, err := newPatchJson6902JSONTransformer(id, operations) if err == nil { t.Fatalf("unexpected error : %v", err) - - if jpt != nil { - err = jpt.Transform(base) - } } if err != nil { if !strings.HasPrefix(err.Error(), "json patch file is empty") { - t.Fatalf("expected error didn't happen, but got %v", err) + t.Fatalf("expected %s, but got %v", "json patch file is empty", err) } } }