forked from libdns/route53
-
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.
feat(cde-2722): allow to not wait for propagation when deleting DNS r…
…ecords (#1) allow to not wait for propagation when deleting DNS records
- Loading branch information
Showing
3 changed files
with
120 additions
and
16 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
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,59 @@ | ||
package route53 | ||
|
||
import ( | ||
"testing" | ||
) | ||
|
||
func TestProvider_shouldWaitForDeletePropagation(t *testing.T) { | ||
type fields struct { | ||
WaitForPropagation bool | ||
WaitForDeletePropagation waitForDeletePropagationOption | ||
} | ||
tests := []struct { | ||
name string | ||
fields fields | ||
want bool | ||
}{ | ||
{ | ||
name: "backwards compatability - should wait", | ||
fields: fields{ | ||
WaitForPropagation: true, | ||
}, | ||
want: true, | ||
}, | ||
{ | ||
name: "backwards compatability - should not wait", | ||
fields: fields{ | ||
WaitForPropagation: false, | ||
}, | ||
want: false, | ||
}, | ||
{ | ||
name: "opposite from WaitForPropagation - should wait", | ||
fields: fields{ | ||
WaitForPropagation: false, | ||
WaitForDeletePropagation: AlwaysWaitForDeletePropagation, | ||
}, | ||
want: true, | ||
}, | ||
{ | ||
name: "opposite from WaitForPropagation - should wait", | ||
fields: fields{ | ||
WaitForPropagation: true, | ||
WaitForDeletePropagation: NeverWaitForDeletePropagation, | ||
}, | ||
want: false, | ||
}, | ||
} | ||
for _, tt := range tests { | ||
t.Run(tt.name, func(t *testing.T) { | ||
p := &Provider{ | ||
WaitForPropagation: tt.fields.WaitForPropagation, | ||
WaitForDeletePropagation: tt.fields.WaitForDeletePropagation, | ||
} | ||
if got := p.shouldWaitForDeletePropagation(); got != tt.want { | ||
t.Errorf("Provider.shouldWaitForDeletePropagation() = %v, want %v", got, tt.want) | ||
} | ||
}) | ||
} | ||
} |