terraform/state/testing.go

23 lines
534 B
Go
Raw Normal View History

2015-02-21 20:52:55 +01:00
package state
import (
"testing"
"github.com/hashicorp/terraform/states"
"github.com/hashicorp/terraform/states/statemgr"
2015-02-21 20:52:55 +01:00
)
// TestState is a helper for testing state implementations. It is expected
// that the given implementation is pre-loaded with the TestStateInitial
// state.
func TestState(t *testing.T, s State) {
t.Helper()
statemgr.TestFull(t, s)
2015-02-21 20:52:55 +01:00
}
2015-02-21 21:25:10 +01:00
// TestStateInitial is the initial state that a State should have
// for TestState.
func TestStateInitial() *states.State {
return statemgr.TestFullInitialState()
2015-02-21 21:25:10 +01:00
}