terraform/config/module/tree_test.go

27 lines
476 B
Go
Raw Normal View History

2014-09-14 23:46:45 +02:00
package module
import (
"reflect"
"testing"
)
func TestTree_Load(t *testing.T) {
tree := NewTree(testConfig(t, "basic"))
if err := tree.Load(testStorage(t), GetModeGet); err != nil {
t.Fatalf("err: %s", err)
}
}
func TestTree_Modules(t *testing.T) {
2014-09-14 23:46:45 +02:00
tree := NewTree(testConfig(t, "basic"))
actual := tree.Modules()
expected := []*Module{
&Module{Name: "foo", Source: "./foo"},
}
if !reflect.DeepEqual(actual, expected) {
t.Fatalf("bad: %#v", actual)
}
}