terraform: add happy path case for resource config
This commit is contained in:
parent
ed57fe7083
commit
0298b47fd8
|
@ -98,6 +98,25 @@ func TestContextValidate_resourceConfig_bad(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
func TestContextValidate_resourceConfig_good(t *testing.T) {
|
||||
config := testConfig(t, "validate-bad-rc")
|
||||
p := testProvider("aws")
|
||||
c := testContext(t, &ContextOpts{
|
||||
Config: config,
|
||||
Providers: map[string]ResourceProviderFactory{
|
||||
"aws": testProviderFuncFixed(p),
|
||||
},
|
||||
})
|
||||
|
||||
w, e := c.Validate()
|
||||
if len(w) > 0 {
|
||||
t.Fatalf("bad: %#v", w)
|
||||
}
|
||||
if len(e) > 0 {
|
||||
t.Fatalf("bad: %#v", e)
|
||||
}
|
||||
}
|
||||
|
||||
func TestContextValidate_requiredVar(t *testing.T) {
|
||||
config := testConfig(t, "validate-required-var")
|
||||
c := testContext(t, &ContextOpts{
|
||||
|
|
Loading…
Reference in New Issue