mirror of
https://github.com/opentofu/opentofu.git
synced 2025-01-02 12:17:39 -06:00
state/remote: passing Atlas state test
This commit is contained in:
parent
aaf182a4a7
commit
bfe0edef51
@ -3,11 +3,19 @@ package remote
|
|||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
|
"github.com/hashicorp/terraform/state"
|
||||||
|
"github.com/hashicorp/terraform/terraform"
|
||||||
)
|
)
|
||||||
|
|
||||||
// testClient is a generic function to test any client.
|
// testClient is a generic function to test any client.
|
||||||
func testClient(t *testing.T, c Client) {
|
func testClient(t *testing.T, c Client) {
|
||||||
data := []byte("foo")
|
var buf bytes.Buffer
|
||||||
|
s := state.TestStateInitial()
|
||||||
|
if err := terraform.WriteState(s, &buf); err != nil {
|
||||||
|
t.Fatalf("err: %s", err)
|
||||||
|
}
|
||||||
|
data := buf.Bytes()
|
||||||
|
|
||||||
if err := c.Put(data); err != nil {
|
if err := c.Put(data); err != nil {
|
||||||
t.Fatalf("put: %s", err)
|
t.Fatalf("put: %s", err)
|
||||||
|
Loading…
Reference in New Issue
Block a user