mirror of
https://github.com/opentofu/opentofu.git
synced 2024-12-28 18:01:01 -06:00
c814f2da37
This mirrors the change made for providers, so that default values can be inserted into the config by the backend implementation. This is only the interface and method name changes, it does not yet add any default values.
31 lines
657 B
Go
31 lines
657 B
Go
package init
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/hashicorp/terraform/backend/remote-state/inmem"
|
|
"github.com/zclconf/go-cty/cty"
|
|
)
|
|
|
|
func TestDeprecateBackend(t *testing.T) {
|
|
deprecateMessage := "deprecated backend"
|
|
deprecatedBackend := deprecateBackend(
|
|
inmem.New(),
|
|
deprecateMessage,
|
|
)
|
|
|
|
_, diags := deprecatedBackend.PrepareConfig(cty.EmptyObjectVal)
|
|
if len(diags) != 1 {
|
|
t.Errorf("got %d diagnostics; want 1", len(diags))
|
|
for _, diag := range diags {
|
|
t.Errorf("- %s", diag)
|
|
}
|
|
return
|
|
}
|
|
|
|
desc := diags[0].Description()
|
|
if desc.Summary != deprecateMessage {
|
|
t.Fatalf("wrong message %q; want %q", desc.Summary, deprecateMessage)
|
|
}
|
|
}
|