terraform: some basic validation

pull/7/head
Mitchell Hashimoto 12 years ago
parent 8aa8d2183e
commit fceea12ade

@ -77,6 +77,10 @@ type GraphNodeResourceProvider struct {
// configured at this point.
//
func Graph(opts *GraphOpts) (*depgraph.Graph, error) {
if opts.Config == nil {
return nil, errors.New("Config is required for Graph")
}
g := new(depgraph.Graph)
// First, build the initial resource graph. This only has the resources

@ -21,6 +21,12 @@ func TestGraph(t *testing.T) {
}
}
func TestGraph_configRequired(t *testing.T) {
if _, err := Graph(new(GraphOpts)); err == nil {
t.Fatal("should error")
}
}
func TestGraph_cycle(t *testing.T) {
config := testConfig(t, "graph-cycle")

Loading…
Cancel
Save