cmd/uplink: Fix a faulty test (#2054)
The test was not considering the proper length of a slice generated with a random length.
This commit is contained in:
parent
5c50aac661
commit
2cdc55d345
@ -70,7 +70,12 @@ func TestUseOrLoadEncryptionKeyIntoEncryptionAccess(t *testing.T) {
|
|||||||
|
|
||||||
access, err := useOrLoadEncryptionAccess(string(rawKey), "")
|
access, err := useOrLoadEncryptionAccess(string(rawKey), "")
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
require.Equal(t, rawKey[:storj.KeySize], access.Key[:])
|
|
||||||
|
if len(rawKey) > storj.KeySize {
|
||||||
|
require.Equal(t, rawKey[:storj.KeySize], access.Key[:])
|
||||||
|
} else {
|
||||||
|
require.Equal(t, rawKey, access.Key[:len(rawKey)])
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
t.Run("error", func(t *testing.T) {
|
t.Run("error", func(t *testing.T) {
|
||||||
|
Loading…
Reference in New Issue
Block a user