state/remote: passing Atlas state test

This commit is contained in:
Mitchell Hashimoto 2015-02-23 17:56:29 -08:00
parent aaf182a4a7
commit bfe0edef51

View File

@ -3,11 +3,19 @@ package remote
import (
"bytes"
"testing"
"github.com/hashicorp/terraform/state"
"github.com/hashicorp/terraform/terraform"
)
// testClient is a generic function to test any 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 {
t.Fatalf("put: %s", err)