forked from hashicorp/terraform-provider-azurerm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
azurerm_storage_account
- fix error handling for static_website
a…
…nd `queue_properties` availability checks (hashicorp#28279)
- Loading branch information
1 parent
e751874
commit 14f86b4
Showing
3 changed files
with
42 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
internal/services/storage/storage_account_data_plane_helpers_test.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package storage | ||
|
||
import ( | ||
"errors" | ||
"testing" | ||
) | ||
|
||
func TestConnectionError(t *testing.T) { | ||
testcases := []struct { | ||
Name string | ||
Error error | ||
ShouldMatch bool | ||
}{ | ||
{ | ||
Name: "No Route TO Host", | ||
Error: errors.New("dial tcp: connecting to example.blob.core.windows.net no route to host"), | ||
ShouldMatch: true, | ||
}, | ||
{ | ||
Name: "DNS No Such Host", | ||
Error: errors.New("dial tcp: lookup example.blob.core.windows.net on 10.0.0.1:53: no such host"), | ||
ShouldMatch: true, | ||
}, | ||
{ | ||
Name: "Proxy Dropped", | ||
Error: errors.New("EOF"), | ||
ShouldMatch: true, | ||
}, | ||
} | ||
|
||
for _, tc := range testcases { | ||
if connectionError(tc.Error) != tc.ShouldMatch { | ||
t.Errorf("expected %s to match but it did not", tc.Name) | ||
} | ||
} | ||
} |