command: go fmt in import_test.go and refresh_test.go
This commit is contained in:
parent
1a654e9e1c
commit
40eda180d6
|
@ -49,7 +49,7 @@ func TestImport(t *testing.T) {
|
||||||
ResourceTypes: map[string]*configschema.Block{
|
ResourceTypes: map[string]*configschema.Block{
|
||||||
"test_instance": {
|
"test_instance": {
|
||||||
Attributes: map[string]*configschema.Attribute{
|
Attributes: map[string]*configschema.Attribute{
|
||||||
"id": {Type: cty.String, Optional: true, Computed: true},
|
"id": {Type: cty.String, Optional: true, Computed: true},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -99,13 +99,13 @@ func TestImport_providerConfig(t *testing.T) {
|
||||||
p.GetSchemaReturn = &terraform.ProviderSchema{
|
p.GetSchemaReturn = &terraform.ProviderSchema{
|
||||||
Provider: &configschema.Block{
|
Provider: &configschema.Block{
|
||||||
Attributes: map[string]*configschema.Attribute{
|
Attributes: map[string]*configschema.Attribute{
|
||||||
"foo": {Type: cty.String, Optional: true},
|
"foo": {Type: cty.String, Optional: true},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
ResourceTypes: map[string]*configschema.Block{
|
ResourceTypes: map[string]*configschema.Block{
|
||||||
"test_instance": {
|
"test_instance": {
|
||||||
Attributes: map[string]*configschema.Attribute{
|
Attributes: map[string]*configschema.Attribute{
|
||||||
"id": {Type: cty.String, Optional: true, Computed: true},
|
"id": {Type: cty.String, Optional: true, Computed: true},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -205,13 +205,13 @@ func TestImport_remoteState(t *testing.T) {
|
||||||
p.GetSchemaReturn = &terraform.ProviderSchema{
|
p.GetSchemaReturn = &terraform.ProviderSchema{
|
||||||
Provider: &configschema.Block{
|
Provider: &configschema.Block{
|
||||||
Attributes: map[string]*configschema.Attribute{
|
Attributes: map[string]*configschema.Attribute{
|
||||||
"foo": {Type: cty.String, Optional: true},
|
"foo": {Type: cty.String, Optional: true},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
ResourceTypes: map[string]*configschema.Block{
|
ResourceTypes: map[string]*configschema.Block{
|
||||||
"test_instance": {
|
"test_instance": {
|
||||||
Attributes: map[string]*configschema.Attribute{
|
Attributes: map[string]*configschema.Attribute{
|
||||||
"id": {Type: cty.String, Optional: true, Computed: true},
|
"id": {Type: cty.String, Optional: true, Computed: true},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -284,13 +284,13 @@ func TestImport_providerConfigWithVar(t *testing.T) {
|
||||||
p.GetSchemaReturn = &terraform.ProviderSchema{
|
p.GetSchemaReturn = &terraform.ProviderSchema{
|
||||||
Provider: &configschema.Block{
|
Provider: &configschema.Block{
|
||||||
Attributes: map[string]*configschema.Attribute{
|
Attributes: map[string]*configschema.Attribute{
|
||||||
"foo": {Type: cty.String, Optional: true},
|
"foo": {Type: cty.String, Optional: true},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
ResourceTypes: map[string]*configschema.Block{
|
ResourceTypes: map[string]*configschema.Block{
|
||||||
"test_instance": {
|
"test_instance": {
|
||||||
Attributes: map[string]*configschema.Attribute{
|
Attributes: map[string]*configschema.Attribute{
|
||||||
"id": {Type: cty.String, Optional: true, Computed: true},
|
"id": {Type: cty.String, Optional: true, Computed: true},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -358,13 +358,13 @@ func TestImport_providerConfigWithVarDefault(t *testing.T) {
|
||||||
p.GetSchemaReturn = &terraform.ProviderSchema{
|
p.GetSchemaReturn = &terraform.ProviderSchema{
|
||||||
Provider: &configschema.Block{
|
Provider: &configschema.Block{
|
||||||
Attributes: map[string]*configschema.Attribute{
|
Attributes: map[string]*configschema.Attribute{
|
||||||
"foo": {Type: cty.String, Optional: true},
|
"foo": {Type: cty.String, Optional: true},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
ResourceTypes: map[string]*configschema.Block{
|
ResourceTypes: map[string]*configschema.Block{
|
||||||
"test_instance": {
|
"test_instance": {
|
||||||
Attributes: map[string]*configschema.Attribute{
|
Attributes: map[string]*configschema.Attribute{
|
||||||
"id": {Type: cty.String, Optional: true, Computed: true},
|
"id": {Type: cty.String, Optional: true, Computed: true},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -431,13 +431,13 @@ func TestImport_providerConfigWithVarFile(t *testing.T) {
|
||||||
p.GetSchemaReturn = &terraform.ProviderSchema{
|
p.GetSchemaReturn = &terraform.ProviderSchema{
|
||||||
Provider: &configschema.Block{
|
Provider: &configschema.Block{
|
||||||
Attributes: map[string]*configschema.Attribute{
|
Attributes: map[string]*configschema.Attribute{
|
||||||
"foo": {Type: cty.String, Optional: true},
|
"foo": {Type: cty.String, Optional: true},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
ResourceTypes: map[string]*configschema.Block{
|
ResourceTypes: map[string]*configschema.Block{
|
||||||
"test_instance": {
|
"test_instance": {
|
||||||
Attributes: map[string]*configschema.Attribute{
|
Attributes: map[string]*configschema.Attribute{
|
||||||
"id": {Type: cty.String, Optional: true, Computed: true},
|
"id": {Type: cty.String, Optional: true, Computed: true},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -505,13 +505,13 @@ func TestImport_customProvider(t *testing.T) {
|
||||||
p.GetSchemaReturn = &terraform.ProviderSchema{
|
p.GetSchemaReturn = &terraform.ProviderSchema{
|
||||||
Provider: &configschema.Block{
|
Provider: &configschema.Block{
|
||||||
Attributes: map[string]*configschema.Attribute{
|
Attributes: map[string]*configschema.Attribute{
|
||||||
"foo": {Type: cty.String, Optional: true},
|
"foo": {Type: cty.String, Optional: true},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
ResourceTypes: map[string]*configschema.Block{
|
ResourceTypes: map[string]*configschema.Block{
|
||||||
"test_instance": {
|
"test_instance": {
|
||||||
Attributes: map[string]*configschema.Attribute{
|
Attributes: map[string]*configschema.Attribute{
|
||||||
"id": {Type: cty.String, Optional: true, Computed: true},
|
"id": {Type: cty.String, Optional: true, Computed: true},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -563,7 +563,7 @@ func TestImport_allowMissingResourceConfig(t *testing.T) {
|
||||||
ResourceTypes: map[string]*configschema.Block{
|
ResourceTypes: map[string]*configschema.Block{
|
||||||
"test_instance": {
|
"test_instance": {
|
||||||
Attributes: map[string]*configschema.Attribute{
|
Attributes: map[string]*configschema.Attribute{
|
||||||
"id": {Type: cty.String, Optional: true, Computed: true},
|
"id": {Type: cty.String, Optional: true, Computed: true},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -343,7 +343,7 @@ func TestRefresh_outPath(t *testing.T) {
|
||||||
t.Fatalf("wrong new object\ngot: %swant: %s", spew.Sdump(actual), spew.Sdump(expected))
|
t.Fatalf("wrong new object\ngot: %swant: %s", spew.Sdump(actual), spew.Sdump(expected))
|
||||||
}
|
}
|
||||||
|
|
||||||
backupState := testStateRead(t, outPath + DefaultBackupExtension)
|
backupState := testStateRead(t, outPath+DefaultBackupExtension)
|
||||||
actualStr := strings.TrimSpace(backupState.String())
|
actualStr := strings.TrimSpace(backupState.String())
|
||||||
expectedStr := strings.TrimSpace(state.String())
|
expectedStr := strings.TrimSpace(state.String())
|
||||||
if actualStr != expectedStr {
|
if actualStr != expectedStr {
|
||||||
|
@ -566,7 +566,7 @@ func TestRefresh_backup(t *testing.T) {
|
||||||
t.Fatalf("wrong new object\ngot: %swant: %s", spew.Sdump(actual), spew.Sdump(expected))
|
t.Fatalf("wrong new object\ngot: %swant: %s", spew.Sdump(actual), spew.Sdump(expected))
|
||||||
}
|
}
|
||||||
|
|
||||||
backupState := testStateRead(t, outPath + DefaultBackupExtension)
|
backupState := testStateRead(t, outPath+DefaultBackupExtension)
|
||||||
actualStr := strings.TrimSpace(backupState.String())
|
actualStr := strings.TrimSpace(backupState.String())
|
||||||
expectedStr := strings.TrimSpace(state.String())
|
expectedStr := strings.TrimSpace(state.String())
|
||||||
if actualStr != expectedStr {
|
if actualStr != expectedStr {
|
||||||
|
|
Loading…
Reference in New Issue