Documentation
¶
Overview ¶
Package mock provides hand-written mock implementations of Prism's plugin interfaces for use in unit and integration tests.
Index ¶
- type CollectionProvider
- func (m *CollectionProvider) GetFranchise(ctx context.Context, collectionID int) (*tmdb.FranchiseDetail, error)
- func (m *CollectionProvider) GetPerson(ctx context.Context, personID int) (*tmdb.Person, error)
- func (m *CollectionProvider) GetPersonFilmography(ctx context.Context, personID int, personType string) ([]tmdb.FilmographyItem, error)
- func (m *CollectionProvider) SearchFranchises(ctx context.Context, query string) ([]tmdb.FranchiseSearchResult, error)
- func (m *CollectionProvider) SearchPeople(ctx context.Context, query string) ([]tmdb.PersonSearchResult, error)
- type DownloadClient
- func (m *DownloadClient) Add(ctx context.Context, r plugin.Release) (string, error)
- func (m *DownloadClient) GetCalls() []string
- func (m *DownloadClient) GetQueue(ctx context.Context) ([]plugin.QueueItem, error)
- func (m *DownloadClient) Name() string
- func (m *DownloadClient) Protocol() plugin.Protocol
- func (m *DownloadClient) Remove(ctx context.Context, clientItemID string, deleteFiles bool) error
- func (m *DownloadClient) SetSeedLimits(ctx context.Context, clientItemID string, ratioLimit float64, seedTimeSecs int) error
- func (m *DownloadClient) Status(ctx context.Context, clientItemID string) (plugin.QueueItem, error)
- func (m *DownloadClient) Test(ctx context.Context) error
- type Indexer
- func (m *Indexer) Capabilities(ctx context.Context) (plugin.Capabilities, error)
- func (m *Indexer) GetRecent(ctx context.Context) ([]plugin.Release, error)
- func (m *Indexer) Name() string
- func (m *Indexer) Protocol() plugin.Protocol
- func (m *Indexer) Search(ctx context.Context, q plugin.SearchQuery) ([]plugin.Release, error)
- func (m *Indexer) Test(ctx context.Context) error
- type Notifier
- type TMDBClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CollectionProvider ¶
type CollectionProvider struct {
GetPersonFunc func(ctx context.Context, personID int) (*tmdb.Person, error)
GetPersonFilmographyFunc func(ctx context.Context, personID int, personType string) ([]tmdb.FilmographyItem, error)
SearchPeopleFunc func(ctx context.Context, query string) ([]tmdb.PersonSearchResult, error)
SearchFranchisesFunc func(ctx context.Context, query string) ([]tmdb.FranchiseSearchResult, error)
GetFranchiseFunc func(ctx context.Context, collectionID int) (*tmdb.FranchiseDetail, error)
}
CollectionProvider is a configurable mock of collection.MetadataProvider.
func (*CollectionProvider) GetFranchise ¶
func (m *CollectionProvider) GetFranchise(ctx context.Context, collectionID int) (*tmdb.FranchiseDetail, error)
func (*CollectionProvider) GetPersonFilmography ¶
func (m *CollectionProvider) GetPersonFilmography(ctx context.Context, personID int, personType string) ([]tmdb.FilmographyItem, error)
func (*CollectionProvider) SearchFranchises ¶
func (m *CollectionProvider) SearchFranchises(ctx context.Context, query string) ([]tmdb.FranchiseSearchResult, error)
func (*CollectionProvider) SearchPeople ¶
func (m *CollectionProvider) SearchPeople(ctx context.Context, query string) ([]tmdb.PersonSearchResult, error)
type DownloadClient ¶
type DownloadClient struct {
AddFunc func(ctx context.Context, r plugin.Release) (string, error)
StatusFunc func(ctx context.Context, clientItemID string) (plugin.QueueItem, error)
GetQueueFunc func(ctx context.Context) ([]plugin.QueueItem, error)
RemoveFunc func(ctx context.Context, clientItemID string, deleteFiles bool) error
TestFunc func(ctx context.Context) error
SetSeedLimitsFunc func(ctx context.Context, clientItemID string, ratioLimit float64, seedTimeSecs int) error
Calls []string
// contains filtered or unexported fields
}
DownloadClient is a configurable mock of plugin.DownloadClient.
func (*DownloadClient) GetCalls ¶
func (m *DownloadClient) GetCalls() []string
GetCalls returns a snapshot of recorded calls (thread-safe).
func (*DownloadClient) Name ¶
func (m *DownloadClient) Name() string
func (*DownloadClient) Protocol ¶
func (m *DownloadClient) Protocol() plugin.Protocol
func (*DownloadClient) SetSeedLimits ¶
type Indexer ¶
type Indexer struct {
CapabilitiesFunc func(ctx context.Context) (plugin.Capabilities, error)
SearchFunc func(ctx context.Context, q plugin.SearchQuery) ([]plugin.Release, error)
GetRecentFunc func(ctx context.Context) ([]plugin.Release, error)
TestFunc func(ctx context.Context) error
Calls []string
}
Indexer is a configurable mock of plugin.Indexer. Set the Func fields to control return values; leave nil to return zero values. Calls records the names of methods that were invoked.
func (*Indexer) Capabilities ¶
type Notifier ¶
type Notifier struct {
NotifyFunc func(ctx context.Context, event plugin.NotificationEvent) error
TestFunc func(ctx context.Context) error
Calls []string
Events []plugin.NotificationEvent
}
Notifier is a configurable mock of plugin.Notifier.
type TMDBClient ¶
type TMDBClient struct {
SearchMoviesFunc func(ctx context.Context, query string, year int) ([]tmdb.SearchResult, error)
GetMovieFunc func(ctx context.Context, tmdbID int) (*tmdb.MovieDetail, error)
Calls []string
}
TMDBClient is a configurable mock of movie.MetadataProvider.
func (*TMDBClient) GetMovie ¶
func (m *TMDBClient) GetMovie(ctx context.Context, tmdbID int) (*tmdb.MovieDetail, error)
func (*TMDBClient) SearchMovies ¶
func (m *TMDBClient) SearchMovies(ctx context.Context, query string, year int) ([]tmdb.SearchResult, error)