mirror of
https://github.com/wneessen/go-mail.git
synced 2024-12-22 18:50:37 +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
|
||||
FailOnReset bool
|
||||
FailOnSTARTTLS bool
|
||||
FailTemp bool
|
||||
FeatureSet string
|
||||
ListenPort int
|
||||
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")
|
||||
break
|
||||
}
|
||||
if props.FailTemp {
|
||||
writeLine("451 4.3.0 Error: fail on DATA close")
|
||||
break
|
||||
}
|
||||
writeLine("250 2.0.0 Ok: queued as 1234567890")
|
||||
break
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue