terraform: verify import with missing type doesn't add to state
This commit is contained in:
parent
58fe557a9f
commit
7fe8b21969
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue