servicestest

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2018 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ServicesTest

type ServicesTest struct {
	DataFS    filesystem.FS
	DB        *database.Database
	ServerURL *url.URL
	Services  *services.Services
	// contains filtered or unexported fields
}

ServicesTest makes it easy to test services

func SetupTest

func SetupTest(t *testing.T) *ServicesTest

SetupTest will create a test App

func (*ServicesTest) AddPGPKeyToUser

func (servicesTest *ServicesTest) AddPGPKeyToUser(user *models.User) (*models.PGPKey, string)

AddPGPKeyToUser will add a pgp key to the user and return public and private key

func (*ServicesTest) AddTokenToUser added in v0.8.0

func (servicesTest *ServicesTest) AddTokenToUser(user *models.User) *models.AccessToken

AddTokenToUser will generate an access token for the given user

func (*ServicesTest) GetOrCreateTestUser

func (servicesTest *ServicesTest) GetOrCreateTestUser() *models.User

GetOrCreateTestUser will get or create the test user and return the user, its pgp key and its private key

Jump to

Keyboard shortcuts

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