terraform: verify import with missing type doesn't add to state

This commit is contained in:
Mitchell Hashimoto 2016-04-30 16:56:22 -05:00
parent 58fe557a9f
commit 7fe8b21969
No known key found for this signature in database
GPG Key ID: 744E147AA52F5B0A
1 changed files with 7 additions and 1 deletions

View File

@ -53,7 +53,7 @@ func TestContextImport_missingType(t *testing.T) {
},
}
_, err := ctx.Import(&ImportOpts{
state, err := ctx.Import(&ImportOpts{
Targets: []*ImportTarget{
&ImportTarget{
Addr: "aws_instance.foo",
@ -64,6 +64,12 @@ func TestContextImport_missingType(t *testing.T) {
if err == nil {
t.Fatal("should error")
}
actual := strings.TrimSpace(state.String())
expected := "<nil>"
if actual != expected {
t.Fatalf("bad: \n%s", actual)
}
}
func TestContextImport_refresh(t *testing.T) {