harness-drone/store/shared/encrypt/none_test.go

23 lines
554 B
Go
Raw Normal View History

2019-02-19 23:56:41 +00:00
// Copyright 2019 Drone.IO Inc. All rights reserved.
// Use of this source code is governed by the Drone Non-Commercial License
// that can be found in the LICENSE file.
package encrypt
import "testing"
func TestNone(t *testing.T) {
n, _ := New("")
ciphertext, err := n.Encrypt("correct-horse-batter-staple")
if err != nil {
t.Error(err)
}
plaintext, err := n.Decrypt(ciphertext)
if err != nil {
t.Error(err)
}
if want, got := plaintext, "correct-horse-batter-staple"; got != want {
t.Errorf("Want plaintext %q, got %q", want, got)
}
}