From fe9ed37dfc604be0fefa872ef5d5dc9ab3898dd7 Mon Sep 17 00:00:00 2001 From: James Bardin Date: Tue, 16 Oct 2018 20:51:47 -0400 Subject: [PATCH] minor fixes for command Apply tests --- command/apply_test.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/command/apply_test.go b/command/apply_test.go index 8195de61cf..2e35c749fc 100644 --- a/command/apply_test.go +++ b/command/apply_test.go @@ -585,8 +585,9 @@ func TestApply_plan_backup(t *testing.T) { if err != nil { t.Fatal(err) } + args := []string{ - "-state-out", statePath, + "-state", statePath, "-backup", backupPath, planPath, } @@ -964,7 +965,7 @@ func TestApply_state(t *testing.T) { Name: "foo", }.Instance(addrs.NoKey).Absolute(addrs.RootModuleInstance), &states.ResourceInstanceObjectSrc{ - AttrsJSON: []byte(`{"ami":"bar"}`), + AttrsJSON: []byte(`{"ami":"foo"}`), Status: states.ObjectReady, }, addrs.ProviderConfig{Type: "test"}.Absolute(addrs.RootModuleInstance), @@ -1006,7 +1007,7 @@ func TestApply_state(t *testing.T) { actual := p.PlanResourceChangeRequest.PriorState expected := cty.ObjectVal(map[string]cty.Value{ "id": cty.NullVal(cty.String), - "ami": cty.StringVal("bar"), + "ami": cty.StringVal("foo"), }) if !expected.RawEquals(actual) { t.Fatalf("wrong prior state during plan\ngot: %#v\nwant: %#v", actual, expected) @@ -1015,9 +1016,9 @@ func TestApply_state(t *testing.T) { actual = p.ApplyResourceChangeRequest.PriorState expected = cty.ObjectVal(map[string]cty.Value{ "id": cty.NullVal(cty.String), - "ami": cty.StringVal("bar"), + "ami": cty.StringVal("foo"), }) - if actual != expected { + if !expected.RawEquals(actual) { t.Fatalf("wrong prior state during apply\ngot: %#v\nwant: %#v", actual, expected) }