You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
677 B
26 lines
677 B
package service |
|
|
|
import ( |
|
"encoding/base64" |
|
"encoding/hex" |
|
"testing" |
|
|
|
"github.com/smartystreets/goconvey/convey" |
|
) |
|
|
|
func TestServiceBase64Decode(t *testing.T) { |
|
convey.Convey("", t, func() { |
|
bytes, err := base64.StdEncoding.DecodeString("igIDgs/yFxaFI+oiu2HoDw==") |
|
convey.So(bytes, convey.ShouldNotBeEmpty) |
|
convey.So(err, convey.ShouldBeNil) |
|
convey.So(hex.EncodeToString(bytes), convey.ShouldEqual, "8a020382cff217168523ea22bb61e80f") |
|
}) |
|
} |
|
|
|
func TestService_cleanTokenCache(t *testing.T) { |
|
once.Do(startService) |
|
convey.Convey("cleanTokenCache", t, func() { |
|
err := s.cleanTokenCache("igIDgs/yFxaFI+oiu2HoDw==", 0) |
|
convey.So(err, convey.ShouldNotBeNil) |
|
}) |
|
}
|
|
|