Update environment variables for SMTP authentication

Renamed environment variables from TEST_USER and TEST_PASS to TEST_SMTPAUTH_USER and TEST_SMTPAUTH_PASS for clarity and consistency in setting SMTP authentication credentials. This change ensures that the correct credentials are applied during tests.
This commit is contained in:
Winni Neessen 2024-10-11 11:55:58 +02:00
parent 021666d6ad
commit c2d9104b45
Signed by: wneessen
GPG key ID: 385AC9889632126E

View file

@ -1188,8 +1188,8 @@ func TestClient_DialWithContext_switchAuth(t *testing.T) {
// We switch to LOGIN auth, which the server supports // We switch to LOGIN auth, which the server supports
client.SetSMTPAuth(SMTPAuthLogin) client.SetSMTPAuth(SMTPAuthLogin)
client.SetUsername(os.Getenv("TEST_USER")) client.SetUsername(os.Getenv("TEST_SMTPAUTH_USER"))
client.SetPassword(os.Getenv("TEST_PASS")) client.SetPassword(os.Getenv("TEST_SMTPAUTH_PASS"))
if err = client.DialWithContext(context.Background()); err != nil { if err = client.DialWithContext(context.Background()); err != nil {
t.Errorf("failed to dial to sending server: %s", err) t.Errorf("failed to dial to sending server: %s", err)
} }
@ -1208,8 +1208,8 @@ func TestClient_DialWithContext_switchAuth(t *testing.T) {
} }
// We switch to CUSTOM by providing PLAIN auth as function - the server supports this // We switch to CUSTOM by providing PLAIN auth as function - the server supports this
client.SetSMTPAuthCustom(smtp.PlainAuth("", os.Getenv("TEST_USER"), os.Getenv("TEST_PASS"), client.SetSMTPAuthCustom(smtp.PlainAuth("", os.Getenv("TEST_SMTPAUTH_USER"),
os.Getenv("TEST_HOST"))) os.Getenv("TEST_SMTPAUTH_PASS"), os.Getenv("TEST_HOST")))
if client.smtpAuthType != SMTPAuthCustom { if client.smtpAuthType != SMTPAuthCustom {
t.Errorf("expected auth type to be Custom, got: %s", client.smtpAuthType) t.Errorf("expected auth type to be Custom, got: %s", client.smtpAuthType)
} }