MCPcopy Index your code
hub / github.com/rclone/rclone / TestNewNameEncryptionMode

Function TestNewNameEncryptionMode

backend/crypt/cipher_test.go:21–40  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

19)
20
21func TestNewNameEncryptionMode(t *testing.T) {
22 for _, test := range []struct {
23 in string
24 expected NameEncryptionMode
25 expectedErr string
26 }{
27 {"off", NameEncryptionOff, ""},
28 {"standard", NameEncryptionStandard, ""},
29 {"obfuscate", NameEncryptionObfuscated, ""},
30 {"potato", NameEncryptionOff, "unknown file name encryption mode \"potato\""},
31 } {
32 actual, actualErr := NewNameEncryptionMode(test.in)
33 assert.Equal(t, actual, test.expected)
34 if test.expectedErr == "" {
35 assert.NoError(t, actualErr)
36 } else {
37 assert.EqualError(t, actualErr, test.expectedErr)
38 }
39 }
40}
41
42func TestNewNameEncryptionModeString(t *testing.T) {
43 assert.Equal(t, NameEncryptionOff.String(), "off")

Callers

nothing calls this directly

Calls 2

NewNameEncryptionModeFunction · 0.85
EqualMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…