terraform: test moving a module to be nested

This commit is contained in:
Mitchell Hashimoto 2016-04-12 15:21:10 -07:00
parent 04598baa25
commit eaf3d608ed
No known key found for this signature in database
GPG Key ID: 744E147AA52F5B0A
1 changed files with 48 additions and 0 deletions

View File

@ -59,6 +59,54 @@ func TestStateAdd(t *testing.T) {
},
},
"ModuleState => Nested Module Addr (new)": {
false,
"",
"module.foo.module.bar",
&ModuleState{
Path: rootModulePath,
Resources: map[string]*ResourceState{
"test_instance.foo": &ResourceState{
Type: "test_instance",
Primary: &InstanceState{
ID: "foo",
},
},
"test_instance.bar": &ResourceState{
Type: "test_instance",
Primary: &InstanceState{
ID: "foo",
},
},
},
},
&State{},
&State{
Modules: []*ModuleState{
&ModuleState{
Path: []string{"root", "foo", "bar"},
Resources: map[string]*ResourceState{
"test_instance.foo": &ResourceState{
Type: "test_instance",
Primary: &InstanceState{
ID: "foo",
},
},
"test_instance.bar": &ResourceState{
Type: "test_instance",
Primary: &InstanceState{
ID: "foo",
},
},
},
},
},
},
},
"ModuleState w/ outputs and deps => Module Addr (new)": {
false,
"",