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 // 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, c cache.Cache) *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 and to the cache. This function is intended to be used as a way to setup test data.
func (*TestPoliteiad) Plugin ¶
func (p *TestPoliteiad) Plugin(t *testing.T, pc v1.PluginCommand)
Plugin is a pass through function for plugin commands. The plugin command is executed in politeiad and is then passed to the cache. This function is intended to be used as a way to setup test data.
Click to show internal directories.
Click to hide internal directories.