terraform: convert more tests

This commit is contained in:
Mitchell Hashimoto 2015-02-08 13:06:11 -08:00
parent cae6deb351
commit ffe9ccacf0
1 changed files with 38 additions and 38 deletions

View File

@ -44,6 +44,44 @@ func TestContext2Validate_badVar(t *testing.T) {
}
}
func TestContext2Validate_moduleBadOutput(t *testing.T) {
p := testProvider("aws")
m := testModule(t, "validate-bad-module-output")
c := testContext2(t, &ContextOpts{
Module: m,
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: %s", e)
}
}
func TestContext2Validate_moduleGood(t *testing.T) {
p := testProvider("aws")
m := testModule(t, "validate-good-module")
c := testContext2(t, &ContextOpts{
Module: m,
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 TestContext2Validate_orphans(t *testing.T) {
p := testProvider("aws")
m := testModule(t, "validate-good")
@ -225,44 +263,6 @@ func TestContext2Validate_selfRefMultiAll(t *testing.T) {
}
/*
func TestContextValidate_goodModule(t *testing.T) {
p := testProvider("aws")
m := testModule(t, "validate-good-module")
c := testContext(t, &ContextOpts{
Module: m,
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_badModuleOutput(t *testing.T) {
p := testProvider("aws")
m := testModule(t, "validate-bad-module-output")
c := testContext(t, &ContextOpts{
Module: m,
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_countNegative(t *testing.T) {
p := testProvider("aws")
m := testModule(t, "validate-count-negative")