From daf66357f6700c035ba21f0ff70aef10f8a9d457 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Wed, 11 Feb 2015 17:07:38 -0800 Subject: [PATCH] terraform: fix tests --- terraform/graph_config_node_test.go | 4 +++- terraform/transform_expand_test.go | 12 ++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/terraform/graph_config_node_test.go b/terraform/graph_config_node_test.go index 7cca96160b..4ebf9bf124 100644 --- a/terraform/graph_config_node_test.go +++ b/terraform/graph_config_node_test.go @@ -21,7 +21,7 @@ func TestGraphNodeConfigModuleExpand(t *testing.T) { node := &GraphNodeConfigModule{ Path: []string{RootModuleName, "child"}, - Module: nil, + Module: &config.Module{}, Tree: nil, } @@ -98,4 +98,6 @@ const testGraphNodeModuleExpandStr = ` aws_instance.bar aws_instance.foo aws_instance.foo + module inputs +module inputs ` diff --git a/terraform/transform_expand_test.go b/terraform/transform_expand_test.go index b63205557e..e0ee9cca26 100644 --- a/terraform/transform_expand_test.go +++ b/terraform/transform_expand_test.go @@ -57,9 +57,17 @@ type testExpandable struct { Builder GraphBuilder } -func (n *testExpandable) Expand(b GraphBuilder) (*Graph, error) { +func (n *testExpandable) Expand(b GraphBuilder) (GraphNodeSubgraph, error) { n.Builder = b - return n.Result, n.ResultError + return &testSubgraph{n.Result}, n.ResultError +} + +type testSubgraph struct { + Graph *Graph +} + +func (n *testSubgraph) Subgraph() *Graph { + return n.Graph } const testExpandTransformStr = `