mirror of
https://github.com/wneessen/go-mail.git
synced 2024-11-15 02:12:55 +01:00
Remove redundant DialWithContext test cases
Deleted two test functions for DialWithContext that tested invalid HELO and authentication scenarios. These tests were deemed redundant as the error handling for these cases is covered elsewhere.
This commit is contained in:
parent
c63b8b124e
commit
cf1246d9ea
1 changed files with 0 additions and 32 deletions
|
@ -1930,38 +1930,6 @@ func TestClient_DialWithContext(t *testing.T) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// TestClient_DialWithContextInvalidHELO tests the DialWithContext method with intentional breaking
|
|
||||||
// for the Client object
|
|
||||||
func TestClient_DialWithContextInvalidHELO(t *testing.T) {
|
|
||||||
c, err := getTestConnection(true)
|
|
||||||
if err != nil {
|
|
||||||
t.Skipf("failed to create test client: %s. Skipping tests", err)
|
|
||||||
}
|
|
||||||
c.helo = ""
|
|
||||||
ctx := context.Background()
|
|
||||||
if err = c.DialWithContext(ctx); err == nil {
|
|
||||||
t.Errorf("dial succeeded but was supposed to fail")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// TestClient_DialWithContextInvalidAuth tests the DialWithContext method with intentional breaking
|
|
||||||
// for the Client object
|
|
||||||
func TestClient_DialWithContextInvalidAuth(t *testing.T) {
|
|
||||||
c, err := getTestConnection(true)
|
|
||||||
if err != nil {
|
|
||||||
t.Skipf("failed to create test client: %s. Skipping tests", err)
|
|
||||||
}
|
|
||||||
c.user = "invalid"
|
|
||||||
c.pass = "invalid"
|
|
||||||
c.SetSMTPAuthCustom(smtp.LoginAuth("invalid", "invalid", "invalid", false))
|
|
||||||
ctx := context.Background()
|
|
||||||
if err = c.DialWithContext(ctx); err == nil {
|
|
||||||
t.Errorf("dial succeeded but was supposed to fail")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// TestClient_checkConn tests the checkConn method with intentional breaking for the Client object
|
// TestClient_checkConn tests the checkConn method with intentional breaking for the Client object
|
||||||
func TestClient_checkConn(t *testing.T) {
|
func TestClient_checkConn(t *testing.T) {
|
||||||
c, err := getTestConnection(true)
|
c, err := getTestConnection(true)
|
||||||
|
|
Loading…
Reference in a new issue