26 lines
582 B
Go
26 lines
582 B
Go
package group
|
|
|
|
import (
|
|
"context"
|
|
"errors"
|
|
"testing"
|
|
|
|
"git.asio.asia/nixevol/NixMsg/internal/protocol"
|
|
)
|
|
|
|
func TestStubCreateNotImplemented(t *testing.T) {
|
|
s := NewStub()
|
|
_, err := s.Create(context.Background(), "a", &protocol.GroupCreate{Name: "g"})
|
|
if !errors.Is(err, ErrNotImplemented) {
|
|
t.Fatalf("got %v", err)
|
|
}
|
|
}
|
|
|
|
func TestStubListEmpty(t *testing.T) {
|
|
s := NewStub()
|
|
items, cursor, err := s.List(context.Background(), "a", &protocol.GroupList{})
|
|
if err != nil || len(items) != 0 || cursor != "" {
|
|
t.Fatalf("items=%v cursor=%q err=%v", items, cursor, err)
|
|
}
|
|
}
|