From dcecb79f63b6ecb741738ec138d5ad8472f9e3f1 Mon Sep 17 00:00:00 2001 From: Nicola Murino Date: Sat, 3 Feb 2024 12:51:12 +0100 Subject: [PATCH] fix expected strings in some test cases plain strings were converted to translation codes Signed-off-by: Nicola Murino --- internal/ftpd/internal_test.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/internal/ftpd/internal_test.go b/internal/ftpd/internal_test.go index fc216d22..027aee1f 100644 --- a/internal/ftpd/internal_test.go +++ b/internal/ftpd/internal_test.go @@ -433,7 +433,7 @@ func TestInitialization(t *testing.T) { CertificateKeyFile: "akey", } assert.False(t, binding.HasProxy()) - assert.Equal(t, "Disabled", binding.GetTLSDescription()) + assert.Equal(t, util.I18nFTPTLSDisabled, binding.GetTLSDescription()) err := c.Initialize(configDir) assert.Error(t, err) c.CertificateFile = "" @@ -490,7 +490,7 @@ func TestInitialization(t *testing.T) { Port: 2121, ClientAuthType: 1, } - assert.Equal(t, "Disabled", binding.GetTLSDescription()) + assert.Equal(t, util.I18nFTPTLSDisabled, binding.GetTLSDescription()) certPath := filepath.Join(os.TempDir(), "test_ftpd.crt") keyPath := filepath.Join(os.TempDir(), "test_ftpd.key") binding.CertificateFile = certPath @@ -505,7 +505,7 @@ func TestInitialization(t *testing.T) { certMgr, err = common.NewCertManager(keyPairs, configDir, "") require.NoError(t, err) - assert.Equal(t, "Plain and explicit", binding.GetTLSDescription()) + assert.Equal(t, util.I18nFTPTLSMixed, binding.GetTLSDescription()) server = NewServer(c, configDir, binding, 0) cfg, err := server.GetTLSConfig() require.NoError(t, err) @@ -541,15 +541,15 @@ func TestServerGetSettings(t *testing.T) { assert.Error(t, err) server.binding.Port = 8021 - assert.Equal(t, "Disabled", binding.GetTLSDescription()) + assert.Equal(t, util.I18nFTPTLSDisabled, binding.GetTLSDescription()) _, err = server.GetTLSConfig() assert.Error(t, err) // TLS configured but cert manager has no certificate binding.TLSMode = 1 - assert.Equal(t, "Explicit required", binding.GetTLSDescription()) + assert.Equal(t, util.I18nFTPTLSExplicit, binding.GetTLSDescription()) binding.TLSMode = 2 - assert.Equal(t, "Implicit", binding.GetTLSDescription()) + assert.Equal(t, util.I18nFTPTLSImplicit, binding.GetTLSDescription()) certPath := filepath.Join(os.TempDir(), "test_ftpd.crt") keyPath := filepath.Join(os.TempDir(), "test_ftpd.key")