mocks

package
v1.85.0 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2025 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClienterMock

type ClienterMock struct {
	// CheckerFunc mocks the Checker method.
	CheckerFunc func(ctx context.Context, check *healthcheck.CheckState) error

	// DoAuthenticatedGetRequestFunc mocks the DoAuthenticatedGetRequest method.
	DoAuthenticatedGetRequestFunc func(ctx context.Context, headers sdk.Headers, uri *url.URL) (*http.Response, error)

	// GetDatasetFunc mocks the GetDataset method.
	GetDatasetFunc func(ctx context.Context, headers sdk.Headers, collectionID string, datasetID string) (models.Dataset, error)

	// GetDatasetByPathFunc mocks the GetDatasetByPath method.
	GetDatasetByPathFunc func(ctx context.Context, headers sdk.Headers, path string) (models.Dataset, error)

	// GetDatasetEditionsFunc mocks the GetDatasetEditions method.
	GetDatasetEditionsFunc func(ctx context.Context, headers sdk.Headers, queryParams *sdk.QueryParams) (sdk.DatasetEditionsList, error)

	// GetEditionFunc mocks the GetEdition method.
	GetEditionFunc func(ctx context.Context, headers sdk.Headers, datasetID string, editionID string) (models.Edition, error)

	// GetEditionsFunc mocks the GetEditions method.
	GetEditionsFunc func(ctx context.Context, headers sdk.Headers, datasetID string, queryParams *sdk.QueryParams) (sdk.EditionsList, error)

	// GetVersionFunc mocks the GetVersion method.
	GetVersionFunc func(ctx context.Context, headers sdk.Headers, datasetID string, editionID string, versionID string) (models.Version, error)

	// GetVersionDimensionOptionsFunc mocks the GetVersionDimensionOptions method.
	GetVersionDimensionOptionsFunc func(ctx context.Context, headers sdk.Headers, datasetID string, editionID string, versionID string, dimensionID string, queryParams *sdk.QueryParams) (sdk.VersionDimensionOptionsList, error)

	// GetVersionDimensionsFunc mocks the GetVersionDimensions method.
	GetVersionDimensionsFunc func(ctx context.Context, headers sdk.Headers, datasetID string, editionID string, versionID string) (sdk.VersionDimensionsList, error)

	// GetVersionMetadataFunc mocks the GetVersionMetadata method.
	GetVersionMetadataFunc func(ctx context.Context, headers sdk.Headers, datasetID string, editionID string, versionID string) (models.Metadata, error)

	// GetVersionsFunc mocks the GetVersions method.
	GetVersionsFunc func(ctx context.Context, headers sdk.Headers, datasetID string, editionID string, queryParams *sdk.QueryParams) (sdk.VersionsList, error)

	// HealthFunc mocks the Health method.
	HealthFunc func() *health.Client

	// PutVersionStateFunc mocks the PutVersionState method.
	PutVersionStateFunc func(ctx context.Context, headers sdk.Headers, datasetID string, editionID string, versionID string, state string) error

	// URLFunc mocks the URL method.
	URLFunc func() string
	// contains filtered or unexported fields
}

ClienterMock is a mock implementation of sdk.Clienter.

func TestSomethingThatUsesClienter(t *testing.T) {

	// make and configure a mocked sdk.Clienter
	mockedClienter := &ClienterMock{
		CheckerFunc: func(ctx context.Context, check *healthcheck.CheckState) error {
			panic("mock out the Checker method")
		},
		DoAuthenticatedGetRequestFunc: func(ctx context.Context, headers sdk.Headers, uri *url.URL) (*http.Response, error) {
			panic("mock out the DoAuthenticatedGetRequest method")
		},
		GetDatasetFunc: func(ctx context.Context, headers sdk.Headers, collectionID string, datasetID string) (models.Dataset, error) {
			panic("mock out the GetDataset method")
		},
		GetDatasetByPathFunc: func(ctx context.Context, headers sdk.Headers, path string) (models.Dataset, error) {
			panic("mock out the GetDatasetByPath method")
		},
		GetDatasetEditionsFunc: func(ctx context.Context, headers sdk.Headers, queryParams *sdk.QueryParams) (sdk.DatasetEditionsList, error) {
			panic("mock out the GetDatasetEditions method")
		},
		GetEditionFunc: func(ctx context.Context, headers sdk.Headers, datasetID string, editionID string) (models.Edition, error) {
			panic("mock out the GetEdition method")
		},
		GetEditionsFunc: func(ctx context.Context, headers sdk.Headers, datasetID string, queryParams *sdk.QueryParams) (sdk.EditionsList, error) {
			panic("mock out the GetEditions method")
		},
		GetVersionFunc: func(ctx context.Context, headers sdk.Headers, datasetID string, editionID string, versionID string) (models.Version, error) {
			panic("mock out the GetVersion method")
		},
		GetVersionDimensionOptionsFunc: func(ctx context.Context, headers sdk.Headers, datasetID string, editionID string, versionID string, dimensionID string, queryParams *sdk.QueryParams) (sdk.VersionDimensionOptionsList, error) {
			panic("mock out the GetVersionDimensionOptions method")
		},
		GetVersionDimensionsFunc: func(ctx context.Context, headers sdk.Headers, datasetID string, editionID string, versionID string) (sdk.VersionDimensionsList, error) {
			panic("mock out the GetVersionDimensions method")
		},
		GetVersionMetadataFunc: func(ctx context.Context, headers sdk.Headers, datasetID string, editionID string, versionID string) (models.Metadata, error) {
			panic("mock out the GetVersionMetadata method")
		},
		GetVersionsFunc: func(ctx context.Context, headers sdk.Headers, datasetID string, editionID string, queryParams *sdk.QueryParams) (sdk.VersionsList, error) {
			panic("mock out the GetVersions method")
		},
		HealthFunc: func() *health.Client {
			panic("mock out the Health method")
		},
		PutVersionStateFunc: func(ctx context.Context, headers sdk.Headers, datasetID string, editionID string, versionID string, state string) error {
			panic("mock out the PutVersionState method")
		},
		URLFunc: func() string {
			panic("mock out the URL method")
		},
	}

	// use mockedClienter in code that requires sdk.Clienter
	// and then make assertions.

}

func (*ClienterMock) Checker

func (mock *ClienterMock) Checker(ctx context.Context, check *healthcheck.CheckState) error

Checker calls CheckerFunc.

func (*ClienterMock) CheckerCalls

func (mock *ClienterMock) CheckerCalls() []struct {
	Ctx   context.Context
	Check *healthcheck.CheckState
}

CheckerCalls gets all the calls that were made to Checker. Check the length with:

len(mockedClienter.CheckerCalls())

func (*ClienterMock) DoAuthenticatedGetRequest

func (mock *ClienterMock) DoAuthenticatedGetRequest(ctx context.Context, headers sdk.Headers, uri *url.URL) (*http.Response, error)

DoAuthenticatedGetRequest calls DoAuthenticatedGetRequestFunc.

func (*ClienterMock) DoAuthenticatedGetRequestCalls

func (mock *ClienterMock) DoAuthenticatedGetRequestCalls() []struct {
	Ctx     context.Context
	Headers sdk.Headers
	URI     *url.URL
}

DoAuthenticatedGetRequestCalls gets all the calls that were made to DoAuthenticatedGetRequest. Check the length with:

len(mockedClienter.DoAuthenticatedGetRequestCalls())

func (*ClienterMock) GetDataset

func (mock *ClienterMock) GetDataset(ctx context.Context, headers sdk.Headers, collectionID string, datasetID string) (models.Dataset, error)

GetDataset calls GetDatasetFunc.

func (*ClienterMock) GetDatasetByPath

func (mock *ClienterMock) GetDatasetByPath(ctx context.Context, headers sdk.Headers, path string) (models.Dataset, error)

GetDatasetByPath calls GetDatasetByPathFunc.

func (*ClienterMock) GetDatasetByPathCalls

func (mock *ClienterMock) GetDatasetByPathCalls() []struct {
	Ctx     context.Context
	Headers sdk.Headers
	Path    string
}

GetDatasetByPathCalls gets all the calls that were made to GetDatasetByPath. Check the length with:

len(mockedClienter.GetDatasetByPathCalls())

func (*ClienterMock) GetDatasetCalls

func (mock *ClienterMock) GetDatasetCalls() []struct {
	Ctx          context.Context
	Headers      sdk.Headers
	CollectionID string
	DatasetID    string
}

GetDatasetCalls gets all the calls that were made to GetDataset. Check the length with:

len(mockedClienter.GetDatasetCalls())

func (*ClienterMock) GetDatasetEditions added in v1.82.0

func (mock *ClienterMock) GetDatasetEditions(ctx context.Context, headers sdk.Headers, queryParams *sdk.QueryParams) (sdk.DatasetEditionsList, error)

GetDatasetEditions calls GetDatasetEditionsFunc.

func (*ClienterMock) GetDatasetEditionsCalls added in v1.82.0

func (mock *ClienterMock) GetDatasetEditionsCalls() []struct {
	Ctx         context.Context
	Headers     sdk.Headers
	QueryParams *sdk.QueryParams
}

GetDatasetEditionsCalls gets all the calls that were made to GetDatasetEditions. Check the length with:

len(mockedClienter.GetDatasetEditionsCalls())

func (*ClienterMock) GetEdition

func (mock *ClienterMock) GetEdition(ctx context.Context, headers sdk.Headers, datasetID string, editionID string) (models.Edition, error)

GetEdition calls GetEditionFunc.

func (*ClienterMock) GetEditionCalls

func (mock *ClienterMock) GetEditionCalls() []struct {
	Ctx       context.Context
	Headers   sdk.Headers
	DatasetID string
	EditionID string
}

GetEditionCalls gets all the calls that were made to GetEdition. Check the length with:

len(mockedClienter.GetEditionCalls())

func (*ClienterMock) GetEditions

func (mock *ClienterMock) GetEditions(ctx context.Context, headers sdk.Headers, datasetID string, queryParams *sdk.QueryParams) (sdk.EditionsList, error)

GetEditions calls GetEditionsFunc.

func (*ClienterMock) GetEditionsCalls

func (mock *ClienterMock) GetEditionsCalls() []struct {
	Ctx         context.Context
	Headers     sdk.Headers
	DatasetID   string
	QueryParams *sdk.QueryParams
}

GetEditionsCalls gets all the calls that were made to GetEditions. Check the length with:

len(mockedClienter.GetEditionsCalls())

func (*ClienterMock) GetVersion

func (mock *ClienterMock) GetVersion(ctx context.Context, headers sdk.Headers, datasetID string, editionID string, versionID string) (models.Version, error)

GetVersion calls GetVersionFunc.

func (*ClienterMock) GetVersionCalls

func (mock *ClienterMock) GetVersionCalls() []struct {
	Ctx       context.Context
	Headers   sdk.Headers
	DatasetID string
	EditionID string
	VersionID string
}

GetVersionCalls gets all the calls that were made to GetVersion. Check the length with:

len(mockedClienter.GetVersionCalls())

func (*ClienterMock) GetVersionDimensionOptions

func (mock *ClienterMock) GetVersionDimensionOptions(ctx context.Context, headers sdk.Headers, datasetID string, editionID string, versionID string, dimensionID string, queryParams *sdk.QueryParams) (sdk.VersionDimensionOptionsList, error)

GetVersionDimensionOptions calls GetVersionDimensionOptionsFunc.

func (*ClienterMock) GetVersionDimensionOptionsCalls

func (mock *ClienterMock) GetVersionDimensionOptionsCalls() []struct {
	Ctx         context.Context
	Headers     sdk.Headers
	DatasetID   string
	EditionID   string
	VersionID   string
	DimensionID string
	QueryParams *sdk.QueryParams
}

GetVersionDimensionOptionsCalls gets all the calls that were made to GetVersionDimensionOptions. Check the length with:

len(mockedClienter.GetVersionDimensionOptionsCalls())

func (*ClienterMock) GetVersionDimensions

func (mock *ClienterMock) GetVersionDimensions(ctx context.Context, headers sdk.Headers, datasetID string, editionID string, versionID string) (sdk.VersionDimensionsList, error)

GetVersionDimensions calls GetVersionDimensionsFunc.

func (*ClienterMock) GetVersionDimensionsCalls

func (mock *ClienterMock) GetVersionDimensionsCalls() []struct {
	Ctx       context.Context
	Headers   sdk.Headers
	DatasetID string
	EditionID string
	VersionID string
}

GetVersionDimensionsCalls gets all the calls that were made to GetVersionDimensions. Check the length with:

len(mockedClienter.GetVersionDimensionsCalls())

func (*ClienterMock) GetVersionMetadata

func (mock *ClienterMock) GetVersionMetadata(ctx context.Context, headers sdk.Headers, datasetID string, editionID string, versionID string) (models.Metadata, error)

GetVersionMetadata calls GetVersionMetadataFunc.

func (*ClienterMock) GetVersionMetadataCalls

func (mock *ClienterMock) GetVersionMetadataCalls() []struct {
	Ctx       context.Context
	Headers   sdk.Headers
	DatasetID string
	EditionID string
	VersionID string
}

GetVersionMetadataCalls gets all the calls that were made to GetVersionMetadata. Check the length with:

len(mockedClienter.GetVersionMetadataCalls())

func (*ClienterMock) GetVersions

func (mock *ClienterMock) GetVersions(ctx context.Context, headers sdk.Headers, datasetID string, editionID string, queryParams *sdk.QueryParams) (sdk.VersionsList, error)

GetVersions calls GetVersionsFunc.

func (*ClienterMock) GetVersionsCalls

func (mock *ClienterMock) GetVersionsCalls() []struct {
	Ctx         context.Context
	Headers     sdk.Headers
	DatasetID   string
	EditionID   string
	QueryParams *sdk.QueryParams
}

GetVersionsCalls gets all the calls that were made to GetVersions. Check the length with:

len(mockedClienter.GetVersionsCalls())

func (*ClienterMock) Health

func (mock *ClienterMock) Health() *health.Client

Health calls HealthFunc.

func (*ClienterMock) HealthCalls

func (mock *ClienterMock) HealthCalls() []struct {
}

HealthCalls gets all the calls that were made to Health. Check the length with:

len(mockedClienter.HealthCalls())

func (*ClienterMock) PutVersionState added in v1.81.2

func (mock *ClienterMock) PutVersionState(ctx context.Context, headers sdk.Headers, datasetID string, editionID string, versionID string, state string) error

PutVersionState calls PutVersionStateFunc.

func (*ClienterMock) PutVersionStateCalls added in v1.81.2

func (mock *ClienterMock) PutVersionStateCalls() []struct {
	Ctx       context.Context
	Headers   sdk.Headers
	DatasetID string
	EditionID string
	VersionID string
	State     string
}

PutVersionStateCalls gets all the calls that were made to PutVersionState. Check the length with:

len(mockedClienter.PutVersionStateCalls())

func (*ClienterMock) URL

func (mock *ClienterMock) URL() string

URL calls URLFunc.

func (*ClienterMock) URLCalls

func (mock *ClienterMock) URLCalls() []struct {
}

URLCalls gets all the calls that were made to URL. Check the length with:

len(mockedClienter.URLCalls())

Jump to

Keyboard shortcuts

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