Skip to content

Commit

Permalink
fcos/v1_6_exp: Add validate test
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam0Brien committed Jul 3, 2023
1 parent fb463d3 commit f55e10e
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions config/fcos/v1_6_exp/validate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -479,3 +479,36 @@ func TestValidateConfig(t *testing.T) {
})
}
}

func TestValidateFileExtension(t *testing.T) {
tests := []struct {
in Config
out error
errPath path.ContextPath
}{
{
in: Config{
Config: base.Config{
Ignition: base.Ignition{
Config: base.IgnitionConfig{
Merge: []base.Resource{
{
Inline: util.StrToPtr("config.ign"),
},
},
},
},
},
},
},
}
for i, test := range tests {
t.Run(fmt.Sprintf("validate %d", i), func(t *testing.T) {
actual := test.in.Validate(path.New("yaml"))
baseutil.VerifyReport(t, test.in, actual)
expected := report.Report{}
expected.AddOnError(test.errPath, test.out)
assert.Equal(t, expected, actual, "invalid report")
})
}
}

0 comments on commit f55e10e

Please sign in to comment.