-
Notifications
You must be signed in to change notification settings - Fork 146
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
18 additions
and
25 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
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 |
---|---|---|
|
@@ -5,7 +5,6 @@ import ( | |
"fmt" | ||
"testing" | ||
|
||
"github.com/facebookgo/ensure" | ||
"github.com/mailgun/mailgun-go/v4" | ||
"github.com/stretchr/testify/require" | ||
) | ||
|
@@ -90,7 +89,7 @@ func TestMailingListMembers(t *testing.T) { | |
theMember, err = mg.GetMember(ctx, "[email protected]", address) | ||
require.NoError(t, err) | ||
require.Equal(t, "Joe's Cool Account", theMember.Name) | ||
ensure.NotNil(t, theMember.Subscribed) | ||
require.NotNil(t, theMember.Subscribed) | ||
require.True(t, *theMember.Subscribed) | ||
} | ||
|
||
|
@@ -125,7 +124,7 @@ func TestMailingLists(t *testing.T) { | |
require.NoError(t, mg.DeleteMailingList(ctx, address)) | ||
|
||
_, err := mg.GetMailingList(ctx, address) | ||
ensure.NotNil(t, err) | ||
require.NotNil(t, err) | ||
}() | ||
|
||
actualCount := countLists() | ||
|
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 |
---|---|---|
|
@@ -260,7 +260,7 @@ func TestSendMGBatchFailRecipients(t *testing.T) { | |
err := m.AddRecipientAndVariables(toUser, nil) | ||
// In case of error the SDK didn't send the message, | ||
// OR the API didn't check for empty To: headers. | ||
ensure.NotNil(t, err) | ||
require.NotNil(t, err) | ||
}) | ||
} | ||
|
||
|
@@ -417,7 +417,7 @@ func TestAddRecipientsError(t *testing.T) { | |
} | ||
|
||
err := m.AddRecipient("[email protected]") | ||
ensure.NotNil(t, err) | ||
require.NotNil(t, err) | ||
require.EqualError(t, err, "recipient limit exceeded (max 1000)") | ||
} | ||
|
||
|
@@ -491,7 +491,7 @@ func TestSendEOFError(t *testing.T) { | |
|
||
m := mailgun.NewMessage(fromUser, exampleSubject, exampleText, toUser) | ||
_, _, err := mg.Send(context.Background(), m) | ||
ensure.NotNil(t, err) | ||
require.NotNil(t, err) | ||
ensure.StringContains(t, err.Error(), "remote server prematurely closed connection: Post ") | ||
ensure.StringContains(t, err.Error(), "EOF") | ||
} | ||
|
@@ -553,7 +553,7 @@ func TestResendStored(t *testing.T) { | |
mg.SetAPIBase(srv.URL + "/v3") | ||
|
||
msg, id, err := mg.ReSend(context.Background(), srv.URL+"/v3/some-url") | ||
ensure.NotNil(t, err) | ||
require.NotNil(t, err) | ||
require.Equal(t, err.Error(), "must provide at least one recipient") | ||
|
||
msg, id, err = mg.ReSend(context.Background(), srv.URL+"/v3/some-url", toUser) | ||
|
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
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