From bc131efd91eb010334d5039e01b1622327f32b0c Mon Sep 17 00:00:00 2001 From: Vlad Klokun Date: Fri, 21 Jul 2023 20:29:04 +0300 Subject: [PATCH] tests(fixhandler): remove tests of an unexported sanitization method Signed-off-by: Vlad Klokun --- core/pkg/fixhandler/fixhandler_test.go | 64 -------------------------- 1 file changed, 64 deletions(-) diff --git a/core/pkg/fixhandler/fixhandler_test.go b/core/pkg/fixhandler/fixhandler_test.go index a372451b..d598dd83 100644 --- a/core/pkg/fixhandler/fixhandler_test.go +++ b/core/pkg/fixhandler/fixhandler_test.go @@ -266,67 +266,3 @@ func Test_fixPathToValidYamlExpression(t *testing.T) { }) } } - -func Test_sanitizeYaml(t *testing.T) { - type args struct { - fileAsString string - } - tests := []struct { - name string - args args - want string - }{ - { - name: "sanitize yaml starting with ---", - args: args{ - fileAsString: "---\nlabel: test", - }, - want: "# ---\nlabel: test", - }, - { - name: "sanitize yaml not starting with ---", - args: args{ - fileAsString: "label: test", - }, - want: "label: test", - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - got := sanitizeYaml(tt.args.fileAsString) - assert.Equal(t, tt.want, got) - }) - } -} - -func Test_revertSanitizeYaml(t *testing.T) { - type args struct { - fixedYamlString string - } - tests := []struct { - name string - args args - want string - }{ - { - name: "revert sanitized yaml starting with ---", - args: args{ - fixedYamlString: "# ---\nlabel: test", - }, - want: "---\nlabel: test", - }, - { - name: "revert sanitized yaml not starting with ---", - args: args{ - fixedYamlString: "label: test", - }, - want: "label: test", - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - got := revertSanitizeYaml(tt.args.fixedYamlString) - assert.Equal(t, tt.want, got) - }) - } -}