client_mock

package
v1.1.7 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: MIT Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	ERR_Unexpected_Url     = "call %q expected url %q, got %q"
	ERR_Unexpected_Data    = "call %q expected data %v, got %v"
	ERR_Unexpected_Headers = "call %q expected headers %v, got %v"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type MockedClient

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

func New added in v1.1.0

func New() *MockedClient

Create new Client instance

func (*MockedClient) AllExpectationsDone

func (m *MockedClient) AllExpectationsDone() error

Check if all expected calls were done

func (*MockedClient) ExpectGet

func (m *MockedClient) ExpectGet(url string, err error, response *http.Response, headers map[string]string)

Store expected call of Get method with expected data and error

func (*MockedClient) ExpectPost

func (m *MockedClient) ExpectPost(url string, body []byte, err error, response *http.Response, headers map[string]string)

Store expected call of Post method with expected data and error

func (*MockedClient) Get

func (m *MockedClient) Get(ctx context.Context, url string, headers map[string]string) (*http.Response, error)

Check if call of Get method was expected and returning expected response and error

func (*MockedClient) Post

func (m *MockedClient) Post(ctx context.Context, url string, body []byte, headers map[string]string) (*http.Response, error)

Check if call of Post method was expected and returning expected response and error

func (*MockedClient) Reset

func (m *MockedClient) Reset()

Reset all expected calls

Jump to

Keyboard shortcuts

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