Merge pull request #26584 from hashicorp/jbardin/var-tests

re-enable and fix module variable tests
This commit is contained in:
James Bardin 2020-10-14 09:16:59 -04:00 committed by GitHub
commit d3307f4864
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 7 deletions

View File

@ -12,7 +12,7 @@ import (
"github.com/hashicorp/terraform/configs"
)
func TestnodeModuleVariablePath(t *testing.T) {
func TestNodeModuleVariablePath(t *testing.T) {
n := &nodeModuleVariable{
Addr: addrs.RootModuleInstance.InputVariable("foo"),
Config: &configs.Variable{
@ -27,7 +27,7 @@ func TestnodeModuleVariablePath(t *testing.T) {
}
}
func TestnodeModuleVariableReferenceableName(t *testing.T) {
func TestNodeModuleVariableReferenceableName(t *testing.T) {
n := &nodeExpandModuleVariable{
Addr: addrs.InputVariable{Name: "foo"},
Config: &configs.Variable{
@ -47,7 +47,7 @@ func TestnodeModuleVariableReferenceableName(t *testing.T) {
{
gotSelfPath, gotReferencePath := n.ReferenceOutside()
wantSelfPath := addrs.RootModuleInstance.Child("child", addrs.NoKey)
wantSelfPath := addrs.RootModuleInstance
wantReferencePath := addrs.RootModuleInstance
if got, want := gotSelfPath.String(), wantSelfPath.String(); got != want {
t.Errorf("wrong self path\ngot: %s\nwant: %s", got, want)
@ -59,9 +59,10 @@ func TestnodeModuleVariableReferenceableName(t *testing.T) {
}
func TestnodeModuleVariableReference(t *testing.T) {
func TestNodeModuleVariableReference(t *testing.T) {
n := &nodeExpandModuleVariable{
Addr: addrs.InputVariable{Name: "foo"},
Addr: addrs.InputVariable{Name: "foo"},
Module: addrs.RootModule.Child("bar"),
Config: &configs.Variable{
Name: "foo",
},
@ -84,9 +85,10 @@ func TestnodeModuleVariableReference(t *testing.T) {
}
}
func TestnodeModuleVariableReference_grandchild(t *testing.T) {
func TestNodeModuleVariableReference_grandchild(t *testing.T) {
n := &nodeExpandModuleVariable{
Addr: addrs.InputVariable{Name: "foo"},
Addr: addrs.InputVariable{Name: "foo"},
Module: addrs.RootModule.Child("bar"),
Config: &configs.Variable{
Name: "foo",
},