update
This commit is contained in:
23
cmd/auth/gettest_test.go
Normal file
23
cmd/auth/gettest_test.go
Normal file
@@ -0,0 +1,23 @@
|
||||
package auth
|
||||
|
||||
import (
|
||||
"os/user"
|
||||
"testing"
|
||||
|
||||
"github.com/zalando/go-keyring"
|
||||
)
|
||||
|
||||
func TestGetToken(t *testing.T) {
|
||||
|
||||
keyring.MockInit()
|
||||
user, _ := user.Current()
|
||||
err := keyring.Set("durpcli", user.Username, "password")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
token := gettoken()
|
||||
if token != "password" {
|
||||
t.Error("password was not expected string")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user