provider/azure: Remove obsolete tests

This commit is contained in:
James Nugent 2015-12-22 15:46:46 -05:00
parent 05983fde21
commit 8aa991cb5d
1 changed files with 8 additions and 38 deletions

View File

@ -127,37 +127,9 @@ func TestAzure_validateSettingsFile(t *testing.T) {
}
func TestAzure_providerConfigure(t *testing.T) {
home, err := homedir.Dir()
if err != nil {
t.Fatalf("Error fetching homedir: %s", err)
}
fh, err := ioutil.TempFile(home, "tf-test-home")
if err != nil {
t.Fatalf("Error creating homedir-based temporary file: %s", err)
}
defer os.Remove(fh.Name())
_, err = io.WriteString(fh, testAzurePublishSettingsStr)
if err != nil {
t.Fatalf("err: %s", err)
}
fh.Close()
r := strings.NewReplacer(home, "~")
homePath := r.Replace(fh.Name())
cases := []struct {
SettingsFile string // String of XML or a path to an XML file
NilMeta bool // whether meta is expected to be nil
}{
{testAzurePublishSettingsStr, false},
{homePath, false},
}
for _, tc := range cases {
rp := Provider()
raw := map[string]interface{}{
"settings_file": tc.SettingsFile,
"publish_settings": testAzurePublishSettingsStr,
}
rawConfig, err := config.NewRawConfig(raw)
@ -167,10 +139,8 @@ func TestAzure_providerConfigure(t *testing.T) {
err = rp.Configure(terraform.NewResourceConfig(rawConfig))
meta := rp.(*schema.Provider).Meta()
if (meta == nil) != tc.NilMeta {
t.Fatalf("expected NilMeta: %t, got meta: %#v, settings_file: %q",
tc.NilMeta, meta, tc.SettingsFile)
}
if meta == nil {
t.Fatal("Expected metadata, got nil: err: %s", err)
}
}