forked from flyteorg/flyte
-
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.
Email recipient pointers (flyteorg#67)
- Loading branch information
1 parent
23b23c1
commit 097e394
Showing
2 changed files
with
29 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,6 +66,25 @@ func TestAwsEmailer_SendEmail(t *testing.T) { | |
assert.Nil(t, testEmail.SendEmail(context.Background(), emailNotification)) | ||
} | ||
|
||
func TestFlyteEmailToSesEmailInput(t *testing.T) { | ||
emailNotification := admin.EmailMessage{ | ||
SubjectLine: "Notice: Execution \"name\" has succeeded in \"domain\".", | ||
SenderEmail: "[email protected]", | ||
RecipientsEmail: []string{ | ||
"[email protected]", | ||
"[email protected]", | ||
}, | ||
Body: "Execution \"name\" has succeeded in \"domain\". View details at " + | ||
"<a href=\"https://example.com/executions/T/B/D\">" + | ||
"https://example.com/executions/T/B/D</a>.", | ||
} | ||
|
||
sesEmailInput := FlyteEmailToSesEmailInput(emailNotification) | ||
assert.Equal(t, *sesEmailInput.Destination.ToAddresses[0], emailNotification.RecipientsEmail[0]) | ||
assert.Equal(t, *sesEmailInput.Destination.ToAddresses[1], emailNotification.RecipientsEmail[1]) | ||
assert.Equal(t, *sesEmailInput.Message.Subject.Data, "Notice: Execution \"name\" has succeeded in \"domain\".") | ||
} | ||
|
||
func TestAwsEmailer_SendEmailError(t *testing.T) { | ||
mockAwsEmail := mocks.SESClient{} | ||
var awsSES sesiface.SESAPI | ||
|