mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
core: Context plan tests expect a new error message for prevent_destroy
This error message has been revised as part of changing it to use diagnostics instead of an error string directly.
This commit is contained in:
parent
5a77045a61
commit
d6d655f21d
@ -908,7 +908,7 @@ func TestContext2Plan_preventDestroy_bad(t *testing.T) {
|
||||
|
||||
plan, err := ctx.Plan()
|
||||
|
||||
expectedErr := "aws_instance.foo: the plan would destroy"
|
||||
expectedErr := "aws_instance.foo has lifecycle.prevent_destroy"
|
||||
if !strings.Contains(fmt.Sprintf("%s", err), expectedErr) {
|
||||
t.Fatalf("expected err would contain %q\nerr: %s\nplan: %s",
|
||||
expectedErr, err, plan)
|
||||
@ -989,7 +989,7 @@ func TestContext2Plan_preventDestroy_countBad(t *testing.T) {
|
||||
|
||||
plan, err := ctx.Plan()
|
||||
|
||||
expectedErr := "aws_instance.foo.1: the plan would destroy"
|
||||
expectedErr := "aws_instance.foo[1] has lifecycle.prevent_destroy"
|
||||
if !strings.Contains(fmt.Sprintf("%s", err), expectedErr) {
|
||||
t.Fatalf("expected err would contain %q\nerr: %s\nplan: %s",
|
||||
expectedErr, err, plan)
|
||||
@ -1113,7 +1113,7 @@ func TestContext2Plan_preventDestroy_destroyPlan(t *testing.T) {
|
||||
|
||||
plan, err := ctx.Plan()
|
||||
|
||||
expectedErr := "aws_instance.foo: the plan would destroy"
|
||||
expectedErr := "aws_instance.foo has lifecycle.prevent_destroy"
|
||||
if !strings.Contains(fmt.Sprintf("%s", err), expectedErr) {
|
||||
t.Fatalf("expected err would contain %q\nerr: %s\nplan: %s",
|
||||
expectedErr, err, plan)
|
||||
|
Loading…
Reference in New Issue
Block a user