test: adds tests for password encodiing

This commit is contained in:
bergquist 2017-11-09 17:55:12 +01:00
parent 5b38c230db
commit d4e8e22fda

View File

@ -7,7 +7,6 @@ import (
)
func TestEncoding(t *testing.T) {
Convey("When generating base64 header", t, func() {
result := GetBasicAuthHeader("grafana", "1234")
@ -23,4 +22,8 @@ func TestEncoding(t *testing.T) {
So(password, ShouldEqual, "1234")
})
Convey("When encoding password", t, func() {
encodedPassword := EncodePassword("iamgod", "pepper")
So(encodedPassword, ShouldEqual, "e59c568621e57756495a468f47c74e07c911b037084dd464bb2ed72410970dc849cabd71b48c394faf08a5405dae53741ce9")
})
}