24 lines
466 B
Go
24 lines
466 B
Go
package identity
|
|
|
|
import (
|
|
"context"
|
|
"errors"
|
|
"testing"
|
|
)
|
|
|
|
func TestStubRegisterNotImplemented(t *testing.T) {
|
|
s := NewStub()
|
|
_, err := s.Register(context.Background(), RegisterRequest{Source: "self"})
|
|
if !errors.Is(err, ErrNotImplemented) {
|
|
t.Fatalf("got %v", err)
|
|
}
|
|
}
|
|
|
|
func TestStubHasTalkGrantFalse(t *testing.T) {
|
|
s := NewStub()
|
|
ok, err := s.HasTalkGrant(context.Background(), "a", "b")
|
|
if err != nil || ok {
|
|
t.Fatalf("ok=%v err=%v", ok, err)
|
|
}
|
|
}
|