Documentation
¶
Index ¶
- type TestService
- func (ts *TestService) Cleanup()
- func (ts *TestService) CreateHostUser(ctx context.Context, username string) (*store.User, error)
- func (ts *TestService) CreateRegularUser(ctx context.Context, username string) (*store.User, error)
- func (*TestService) CreateUserContext(ctx context.Context, userID int32) context.Context
- func (ts *TestService) InviteAndAcceptSpaceMember(ctx context.Context, create *store.SpaceMember, actorUserID int32) (*store.SpaceMember, error)
- func (ts *TestService) SetInstanceAccessMode(ctx context.Context, mode storepb.InstanceAccessMode) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TestService ¶
type TestService struct {
Service *apiv1.APIV1Service
Store *store.Store
Profile *profile.Profile
Secret string
}
TestService holds the test service setup for API v1 services.
func NewTestService ¶
func NewTestService(t *testing.T) *TestService
NewTestService creates a new test service with SQLite database.
func (*TestService) CreateHostUser ¶
CreateHostUser creates an admin user for testing.
func (*TestService) CreateRegularUser ¶
CreateRegularUser creates a regular user for testing.
func (*TestService) CreateUserContext ¶
CreateUserContext creates a context with the given user's ID for authentication.
func (*TestService) InviteAndAcceptSpaceMember ¶
func (ts *TestService) InviteAndAcceptSpaceMember(ctx context.Context, create *store.SpaceMember, actorUserID int32) (*store.SpaceMember, error)
InviteAndAcceptSpaceMember is a test fixture helper that exercises the invitation lifecycle instead of bypassing invitee consent.
func (*TestService) SetInstanceAccessMode ¶
func (ts *TestService) SetInstanceAccessMode(ctx context.Context, mode storepb.InstanceAccessMode) error
SetInstanceAccessMode updates the instance access policy for a test.
Click to show internal directories.
Click to hide internal directories.