mirror of
https://github.com/zeromicro/go-zero.git
synced 2025-01-23 09:00:20 +08:00
22 lines
481 B
Go
22 lines
481 B
Go
package discov
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
"github.com/zeromicro/go-zero/core/discov/internal"
|
|
"github.com/zeromicro/go-zero/core/stringx"
|
|
)
|
|
|
|
func TestRegisterAccount(t *testing.T) {
|
|
endpoints := []string{
|
|
"localhost:2379",
|
|
}
|
|
user := "foo" + stringx.Rand()
|
|
RegisterAccount(endpoints, user, "bar")
|
|
account, ok := internal.GetAccount(endpoints)
|
|
assert.True(t, ok)
|
|
assert.Equal(t, user, account.User)
|
|
assert.Equal(t, "bar", account.Pass)
|
|
}
|