test

package
v0.0.0-...-8eaf68a Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2017 License: MIT Imports: 13 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() (*repo.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 (*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

Jump to

Keyboard shortcuts

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