harness-drone/shared/model/util_test.go

20 lines
412 B
Go
Raw Normal View History

2014-06-12 23:43:43 +00:00
package model
import (
"testing"
)
2014-10-22 07:13:47 +00:00
func Test_CreateGravatar(t *testing.T) {
var got, want = CreateGravatar("dr_cooper@caltech.edu"), "2b77ba83e2216ddcd11fe8c24b70c2a3"
2014-06-12 23:43:43 +00:00
if got != want {
t.Errorf("Got gravatar hash %s, want %s", got, want)
}
}
2014-10-22 07:13:47 +00:00
func Test_GenerateToken(t *testing.T) {
token := GenerateToken()
2014-06-12 23:43:43 +00:00
if len(token) != length {
t.Errorf("Want token length %d, got %d", length, len(token))
}
}