mirror of
https://github.com/0rangebananaspy/authelia.git
synced 2024-09-14 22:47:21 +07:00
16 lines
393 B
Go
16 lines
393 B
Go
|
package totp
|
||
|
|
||
|
import (
|
||
|
"testing"
|
||
|
|
||
|
"github.com/pquerna/otp"
|
||
|
"github.com/stretchr/testify/assert"
|
||
|
)
|
||
|
|
||
|
func TestOTPStringToAlgo(t *testing.T) {
|
||
|
assert.Equal(t, otp.AlgorithmSHA1, otpStringToAlgo("SHA1"))
|
||
|
assert.Equal(t, otp.AlgorithmSHA256, otpStringToAlgo("SHA256"))
|
||
|
assert.Equal(t, otp.AlgorithmSHA512, otpStringToAlgo("SHA512"))
|
||
|
assert.Equal(t, otp.AlgorithmSHA1, otpStringToAlgo(""))
|
||
|
}
|