mocks

package
v3.0.6 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ShouldMakeAPIFailMediaItem will make API fail.
	ShouldMakeAPIFailMediaItem = "should-make-API-fail"

	// ShouldReturnEmptyMediaItem will return an empty media item.
	ShouldReturnEmptyMediaItem = "should-return-empty-media-item"

	// AlbumShouldFail used as album ID or Title to make the album service fail.
	AlbumShouldFail = "should-fail"

	// UploadShouldFail used as X-Goog-Upload-Name to make the upload service fai.
	UploadShouldFail = "upload-should-fail"

	// UploadToken is sent when the upload was successful.
	UploadToken = "valid-upload-token"

	// ShouldResumeUpload is the URL to resume an upload.
	ShouldResumeUpload = "/v1/upload-session/started"

	// ShouldReachDailyQuota used as album ID will return daily quota exceeded error.
	ShouldReachDailyQuota = "should-reach-daily-quota"

	// PageTokenShouldFail makes fail a paginated call.
	PageTokenShouldFail = "should-fail"
)
View Source
const (

	// AvailableMediaItems is the number of media items in the fake collection. It should be bigger than `maxItemsPerPage`.
	AvailableMediaItems = 150
	// AvailableAlbums is the number of media items in the fake collection. It should be bigger than `maxItemsPerPage`.
	AvailableAlbums = 75
)
View Source
const SampleGoogleRequestPerDayExceededBodyResponse = `` /* 1327-byte string literal not displayed */

Variables

View Source
var (
	// ExistingAlbum is an existing album used for testing purposes.
	ExistingAlbum = &photoslibrary.Album{
		CoverPhotoBaseUrl: "fooCoverPhotoBaseUrl",
		Id:                "fooId",
		ProductUrl:        "fooProductUrl",
		Title:             "fooTitle",
	}
)
View Source
var (
	// ShouldFailAlbum is an album that will make the API fail.
	ShouldFailAlbum = &photoslibrary.Album{
		Id:    AlbumShouldFail,
		Title: AlbumShouldFail,
	}
)

Functions

This section is empty.

Types

type MockedGooglePhotosService

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

MockedGooglePhotosService mocks the Google Photos service.

func NewMockedGooglePhotosService

func NewMockedGooglePhotosService() *MockedGooglePhotosService

NewMockedGooglePhotosService returns a mocked Google Photos service.

func (*MockedGooglePhotosService) Close

func (ms *MockedGooglePhotosService) Close()

Close closes the HTTP server.

func (*MockedGooglePhotosService) URL

URL returns the HTTP server url.

Jump to

Keyboard shortcuts

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