From 7d670a1f2457610a562b4dfcdfbbb1d50637aed0 Mon Sep 17 00:00:00 2001 From: Winni Neessen Date: Mon, 28 Oct 2024 17:31:11 +0100 Subject: [PATCH] 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. --- client_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/client_test.go b/client_test.go index 46c7dcd..8408035 100644 --- a/client_test.go +++ b/client_test.go @@ -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 }