Add validation for custom SMTP auth type in client tests

Previously, only the presence of the SMTP auth method was checked, but not its type. This additional validation ensures that the SMTP auth type is correctly set to custom, thereby improving test accuracy.
This commit is contained in:
Winni Neessen 2024-10-04 22:36:28 +02:00
parent 972a3c51c7
commit 8942b08424
Signed by: wneessen
GPG key ID: 385AC9889632126E

View file

@ -602,6 +602,10 @@ func TestSetSMTPAuthCustom(t *testing.T) {
if c.smtpAuth == nil {
t.Errorf("failed to set custom SMTP auth method. SMTP Auth method is empty")
}
if c.smtpAuthType != SMTPAuthCustom {
t.Errorf("failed to set custom SMTP auth method. SMTP Auth type is not custom: %s",
c.smtpAuthType)
}
p, _, err := c.smtpAuth.Start(&si)
if err != nil {
t.Errorf("SMTP Auth Start() method returned error: %s", err)