tests(fixhandler): remove tests of an unexported sanitization method

Signed-off-by: Vlad Klokun <vklokun@protonmail.ch>
This commit is contained in:
Vlad Klokun
2023-07-21 20:29:04 +03:00
parent 4763f0d69d
commit bc131efd91
-64
View File
@@ -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)
})
}
}