mirror of
https://github.com/wneessen/go-mail.git
synced 2024-11-15 02:12:55 +01:00
Add temporary failure condition in client test
Introduce a new `FailTemp` property to simulate a temporary failure during the DATA transmission phase in tests. This helps ensure better coverage and handling of specific error conditions.
This commit is contained in:
parent
2f3809f33e
commit
7d670a1f24
1 changed files with 5 additions and 0 deletions
|
@ -3559,6 +3559,7 @@ type serverProps struct {
|
||||||
FailOnQuit bool
|
FailOnQuit bool
|
||||||
FailOnReset bool
|
FailOnReset bool
|
||||||
FailOnSTARTTLS bool
|
FailOnSTARTTLS bool
|
||||||
|
FailTemp bool
|
||||||
FeatureSet string
|
FeatureSet string
|
||||||
ListenPort int
|
ListenPort int
|
||||||
SSLListener bool
|
SSLListener bool
|
||||||
|
@ -3720,6 +3721,10 @@ func handleTestServerConnection(connection net.Conn, t *testing.T, props *server
|
||||||
writeLine("500 5.0.0 Error during DATA transmission")
|
writeLine("500 5.0.0 Error during DATA transmission")
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
if props.FailTemp {
|
||||||
|
writeLine("451 4.3.0 Error: fail on DATA close")
|
||||||
|
break
|
||||||
|
}
|
||||||
writeLine("250 2.0.0 Ok: queued as 1234567890")
|
writeLine("250 2.0.0 Ok: queued as 1234567890")
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue