mocks

package
v0.0.0-...-5d46da9 Latest Latest
Warning

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

Go to latest
Published: May 19, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BundlerMock

type BundlerMock struct {
	CalledBundleArgs bundler.Args
	ReturnError      error
}

func (*BundlerMock) Bundle

func (m *BundlerMock) Bundle(args bundler.Args) error

type FetcherMock

type FetcherMock struct {
	mock.Mock
}

func (*FetcherMock) GetInitialPage

func (m *FetcherMock) GetInitialPage() (io.ReadCloser, error)

func (*FetcherMock) GetPage

func (m *FetcherMock) GetPage(url string) (io.ReadCloser, error)

func (*FetcherMock) InitialPageUrl

func (m *FetcherMock) InitialPageUrl() string

type FileWriterMock

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

func NewFilewriterMock

func NewFilewriterMock() *FileWriterMock

func (*FileWriterMock) AllFilesClosed

func (fileWriterMock *FileWriterMock) AllFilesClosed() (allFilesClosed bool)

func (*FileWriterMock) Create

func (fileWriterMock *FileWriterMock) Create(name string) (io.WriteCloser, error)

func (*FileWriterMock) DirectoriesCreated

func (fileWriterMock *FileWriterMock) DirectoriesCreated() (dirNames []string)

func (*FileWriterMock) ErrorOnCreate

func (fileWriterMock *FileWriterMock) ErrorOnCreate(name string, err error)

func (*FileWriterMock) ErrorOnMkdirAll

func (fileWriterMock *FileWriterMock) ErrorOnMkdirAll(name string, err error)

func (*FileWriterMock) ErrorOnSaveJson

func (fileWriterMock *FileWriterMock) ErrorOnSaveJson(name string, err error)

func (*FileWriterMock) ErrorOnWrite

func (fileWriterMock *FileWriterMock) ErrorOnWrite(name string, err error)

func (*FileWriterMock) FileNamesWritten

func (fileWriterMock *FileWriterMock) FileNamesWritten() (fNames []string)

func (*FileWriterMock) FileWritten

func (fileWriterMock *FileWriterMock) FileWritten(fname string) *WriteCloserMock

func (*FileWriterMock) JsonFileSaved

func (fileWriterMock *FileWriterMock) JsonFileSaved(fname string) interface{}

func (*FileWriterMock) MkdirAll

func (fileWriterMock *FileWriterMock) MkdirAll(name string) error

func (*FileWriterMock) SaveJsonFile

func (fileWriterMock *FileWriterMock) SaveJsonFile(name string, value interface{}) error

type HttpClientMock

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

func NewHttpClientMock

func NewHttpClientMock() *HttpClientMock

func (*HttpClientMock) OnRequest

func (httpClientMock *HttpClientMock) OnRequest(url, responseData string, statusCode int)

func (*HttpClientMock) RequestCount

func (httpClientMock *HttpClientMock) RequestCount(url string) int

func (*HttpClientMock) RoundTrip

func (httpClientMock *HttpClientMock) RoundTrip(req *http.Request) (*http.Response, error)

func (*HttpClientMock) ToHttpClient

func (httpClientMock *HttpClientMock) ToHttpClient() *http.Client

type ReadCloseMock

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

func NewErrReadCloseMock

func NewErrReadCloseMock(errorOnRead error) *ReadCloseMock

func NewReadCloseMock

func NewReadCloseMock(data string) *ReadCloseMock

func (*ReadCloseMock) AssertCloseCalled

func (mock *ReadCloseMock) AssertCloseCalled(t *testing.T) bool

func (*ReadCloseMock) Close

func (mock *ReadCloseMock) Close() error

func (*ReadCloseMock) Read

func (mock *ReadCloseMock) Read(p []byte) (n int, err error)

type WriteCloserMock

type WriteCloserMock struct {
	FileName       string
	FileContent    []byte
	Closed         bool
	WriteError     error
	FileWriterMock *FileWriterMock
}

func (*WriteCloserMock) Close

func (writerCloserMock *WriteCloserMock) Close() error

func (*WriteCloserMock) Write

func (writerCloserMock *WriteCloserMock) Write(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

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