test

package
v0.13.8-rc4 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2020 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAuthCookie

func GetAuthCookie() *http.Cookie

GetAuthCookie returns a pointer to a test authentication cookie

func GetPassword

func GetPassword() string

GetPassword returns a static mneumonic to use

func GetRepoPath

func GetRepoPath() string

GetRepoPath returns the repo path to use for tests It should be considered volitile and may be destroyed at any time

func NewAPIConfig

func NewAPIConfig() (*schema.APIConfig, error)

NewAPIConfig returns a new config object for the API tests

func NewLogger

func NewLogger() logging.LeveledBackend

func NewNode

func NewNode() (*core.OpenBazaarNode, error)

NewNode creates a new *core.OpenBazaarNode prepared for testing

Types

type Repository

type Repository struct {
	Path     string
	Password string
	DB       *db.SQLiteDatastore
}

Repository represents a test (temporary/volitile) repository

func NewRepository

func NewRepository() (*Repository, error)

NewRepository creates and initializes a new temporary repository for tests

func ResetRepository added in v0.12.1

func ResetRepository() (*Repository, error)

func (*Repository) ConfigFile

func (r *Repository) ConfigFile() string

ConfigFile returns the path to the test configuration file

func (*Repository) MustReset

func (r *Repository) MustReset()

MustReset sets the repo state back to a blank slate but retains keys It panics upon failure instead of allowing tests to continue

func (*Repository) RemoveRepo

func (r *Repository) RemoveRepo() error

RemoveRepo removes the test repository

func (*Repository) RemoveRoot

func (r *Repository) RemoveRoot() error

RemoveRoot removes the profile json from the repository

func (*Repository) RemoveSettings

func (r *Repository) RemoveSettings() error

RemoveSettings purges settings from the database

func (*Repository) Reset

func (r *Repository) Reset() error

Reset sets the repo state back to a blank slate but retains keys Initialize the IPFS repo if it does not already exist

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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