test

package
v0.31.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 19, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

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) Cleanup

func (ts *TestService) Cleanup()

Cleanup closes resources after test.

func (*TestService) CreateHostUser

func (ts *TestService) CreateHostUser(ctx context.Context, username string) (*store.User, error)

CreateHostUser creates an admin user for testing.

func (*TestService) CreateRegularUser

func (ts *TestService) CreateRegularUser(ctx context.Context, username string) (*store.User, error)

CreateRegularUser creates a regular user for testing.

func (*TestService) CreateUserContext

func (*TestService) CreateUserContext(ctx context.Context, userID int32) context.Context

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL