test

package
v0.25.2 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2025 License: MIT Imports: 6 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 clears caches and closes resources after test.

func (*TestService) CreateHostUser

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

CreateHostUser creates a host 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.

Jump to

Keyboard shortcuts

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