terraform: add happy path case for resource config

This commit is contained in:
Mitchell Hashimoto 2014-07-03 12:31:26 -07:00
parent ed57fe7083
commit 0298b47fd8
1 changed files with 19 additions and 0 deletions

View File

@ -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) { func TestContextValidate_requiredVar(t *testing.T) {
config := testConfig(t, "validate-required-var") config := testConfig(t, "validate-required-var")
c := testContext(t, &ContextOpts{ c := testContext(t, &ContextOpts{