Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface {
Get(key string) (io.ReadCloser, *int64, error)
}
Client is an interface to represent methods called to action upon S3
type ClientMock ¶
type ClientMock struct { // GetFunc mocks the Get method. GetFunc func(key string) (io.ReadCloser, *int64, error) // contains filtered or unexported fields }
ClientMock is a mock implementation of Client.
func TestSomethingThatUsesClient(t *testing.T) { // make and configure a mocked Client mockedClient := &ClientMock{ GetFunc: func(key string) (io.ReadCloser, *int64, error) { panic("mock out the Get method") }, } // use mockedClient in code that requires Client // and then make assertions. }
func (*ClientMock) Get ¶
func (mock *ClientMock) Get(key string) (io.ReadCloser, *int64, error)
Get calls GetFunc.
func (*ClientMock) GetCalls ¶
func (mock *ClientMock) GetCalls() []struct { Key string }
GetCalls gets all the calls that were made to Get. Check the length with:
len(mockedClient.GetCalls())
Click to show internal directories.
Click to hide internal directories.