command: Fix all of the "taint" command tests

Most of this is just updates to allow for the fact that we now always save
the provider address as part of resource state, whereas before it was only
saved conditionally.

This also updates TestTaint_module for the intentional change that it now
expects a child module to be specified using normal resource address
syntax, rather than as a separate -module option.
This commit is contained in:
Martin Atkins 2018-10-09 17:01:57 -07:00
parent 8321c3614f
commit 1bc10180cb
1 changed files with 5 additions and 2 deletions

View File

@ -379,9 +379,8 @@ func TestTaint_module(t *testing.T) {
}
args := []string{
"-module=child",
"-state", statePath,
"test_instance.blah",
"module.child.test_instance.blah",
}
if code := c.Run(args); code != 0 {
t.Fatalf("bad: %d\n\n%s", code, ui.ErrorWriter.String())
@ -393,18 +392,22 @@ func TestTaint_module(t *testing.T) {
const testTaintStr = `
test_instance.foo: (tainted)
ID = bar
provider = provider.test
`
const testTaintDefaultStr = `
test_instance.foo:
ID = bar
provider = provider.test
`
const testTaintModuleStr = `
test_instance.foo:
ID = bar
provider = provider.test
module.child:
test_instance.blah: (tainted)
ID = blah
provider = provider.test
`