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
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 ¶
CreateHostUser creates a host 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.
Click to show internal directories.
Click to hide internal directories.