-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SES: list_identities() now supports the IdentityType-parameter (#6956)
- Loading branch information
Showing
3 changed files
with
35 additions
and
18 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 |
---|---|---|
|
@@ -11,13 +11,32 @@ | |
|
||
|
||
@mock_ses | ||
def test_verify_email_identity(): | ||
def test_list_verified_identities(): | ||
conn = boto3.client("ses", region_name="us-east-1") | ||
conn.verify_email_identity(EmailAddress="[email protected]") | ||
|
||
identities = conn.list_identities() | ||
address = identities["Identities"][0] | ||
assert address == "[email protected]" | ||
identities = conn.list_identities()["Identities"] | ||
assert identities == ["[email protected]"] | ||
|
||
conn.verify_domain_dkim(Domain="domain1.com") | ||
conn.verify_domain_identity(Domain="domain2.com") | ||
|
||
identities = conn.list_identities()["Identities"] | ||
assert identities == ["domain1.com", "domain2.com", "[email protected]"] | ||
|
||
identities = conn.list_identities(IdentityType="EmailAddress")["Identities"] | ||
assert identities == ["[email protected]"] | ||
|
||
identities = conn.list_identities(IdentityType="Domain")["Identities"] | ||
assert identities == ["domain1.com", "domain2.com"] | ||
|
||
with pytest.raises(ClientError) as exc: | ||
conn.list_identities(IdentityType="Unknown") | ||
err = exc.value.response["Error"] | ||
assert ( | ||
err["Message"] | ||
== "Value 'Unknown' at 'identityType' failed to satisfy constraint: Member must satisfy enum value set: [Domain, EmailAddress]" | ||
) | ||
|
||
|
||
@mock_ses | ||
|
@@ -50,18 +69,6 @@ def test_verify_email_address(): | |
assert email == "[email protected]" | ||
|
||
|
||
@mock_ses | ||
def test_domain_verify(): | ||
conn = boto3.client("ses", region_name="us-east-1") | ||
|
||
conn.verify_domain_dkim(Domain="domain1.com") | ||
conn.verify_domain_identity(Domain="domain2.com") | ||
|
||
identities = conn.list_identities() | ||
domains = list(identities["Identities"]) | ||
assert domains == ["domain1.com", "domain2.com"] | ||
|
||
|
||
@mock_ses | ||
def test_delete_identity(): | ||
conn = boto3.client("ses", region_name="us-east-1") | ||
|