echidnatesting

package
v0.0.0-...-7d29f3a Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package echidnatesting provides the exported MockClient for all tests that need to send web requests

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockClient

type MockClient struct {
	// contains filtered or unexported fields
}

MockClient lets us Mock the http.client's Do() func so we can do testing without making requests

func (*MockClient) Do

func (m *MockClient) Do(req *http.Request) (*http.Response, error)

Do Satisfies the HTTPClient interface. Pseudo Do() function

func (*MockClient) DummyBody

func (m *MockClient) DummyBody() string

DummyBody returns a byte array containing a fake wp plugin struct that can be unmarshaled

func (*MockClient) SetReply

func (m *MockClient) SetReply(resCode int, body, err string)

SetReply lets us set the servers reply for the mocked request

Jump to

Keyboard shortcuts

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