testpoliteiad

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2021 License: ISC Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TestPoliteiad

type TestPoliteiad struct {
	sync.RWMutex

	URL            string // Base url of form http://ipaddr:port
	PublicIdentity *identity.PublicIdentity
	FullIdentity   *identity.FullIdentity
	// contains filtered or unexported fields
}

TestPoliteiad provides an implementation of the politeiad api that can be used for testing politeiad clients. The api is implemented using an httptest server and all records and plugin data is stored in memory.

func New

func New(t *testing.T) *TestPoliteiad

New returns a new TestPoliteiad context.

func (*TestPoliteiad) AddRecord

func (p *TestPoliteiad) AddRecord(t *testing.T, r v1.Record)

AddRecord adds a record to the politeiad records store. This function is intended to be used as a way to setup test data.

func (*TestPoliteiad) Close

func (p *TestPoliteiad) Close()

Close shuts down the httptest server.

func (*TestPoliteiad) Plugin

func (p *TestPoliteiad) Plugin(t *testing.T, pc v1.PluginCommand)

Plugin is a pass through function for plugin commands. This function is intended to be used as a way to setup test data.

Jump to

Keyboard shortcuts

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