Skip to content

Commit

Permalink
fix expected strings in some test cases
Browse files Browse the repository at this point in the history
plain strings were converted to translation codes

Signed-off-by: Nicola Murino <[email protected]>
  • Loading branch information
drakkan committed Feb 3, 2024
1 parent 71e01ab commit dcecb79
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions internal/ftpd/internal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ""
Expand Down Expand Up @@ -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
Expand All @@ -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)
Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit dcecb79

Please sign in to comment.