Documentation
¶
Overview ¶
Package pcloudtest provides test helpers for the pcloud package, following the net/http → net/http/httptest convention.
Index ¶
- type StubAPI
- func (s *StubAPI) DeleteFile(path string) (models.DeletefileResponse, error)
- func (s *StubAPI) DeleteFolderRecursive(path string) (models.DeletefolderRecursiveResponse, error)
- func (s *StubAPI) GetFileLink(path string) (models.GetfileResponse, error)
- func (s *StubAPI) GetZipLinkByFolderID(folderID int, filename string, forceDownload bool) (models.GetziplinkResponse, error)
- func (s *StubAPI) ListFolder(path string, opts pcloud.ListFolderOptions) (models.ListfolderResponse, error)
- func (s *StubAPI) RenameFile(src, dst string) (models.RenamefileResponse, error)
- func (s *StubAPI) RenameFolder(src, dst string) (models.RenamefolderResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type StubAPI ¶
type StubAPI struct {
ListFolderResult models.ListfolderResponse
ListFolderErr error
DeleteFileErr error
DeleteFolderErr error
RenameFileErr error
RenameFolderErr error
GetFileLinkResult models.GetfileResponse
GetFileLinkErr error
GetZipLinkResult models.GetziplinkResponse
GetZipLinkErr error
// call recorders
ListFolderCalls []string
DeleteFileCalls []string
DeleteFolderCalls []string
RenameFileCalls [][2]string
RenameFolderCalls [][2]string
GetFileLinkCalls []string
}
StubAPI is a configurable fake that satisfies pcloud.CloudAPI. Set the Err* fields to inject errors and *Result fields to control return payloads. The *Calls slices record arguments for test assertions.
func (*StubAPI) DeleteFile ¶
func (s *StubAPI) DeleteFile(path string) (models.DeletefileResponse, error)
func (*StubAPI) DeleteFolderRecursive ¶
func (s *StubAPI) DeleteFolderRecursive(path string) (models.DeletefolderRecursiveResponse, error)
func (*StubAPI) GetFileLink ¶
func (s *StubAPI) GetFileLink(path string) (models.GetfileResponse, error)
func (*StubAPI) GetZipLinkByFolderID ¶
func (*StubAPI) ListFolder ¶
func (s *StubAPI) ListFolder(path string, opts pcloud.ListFolderOptions) (models.ListfolderResponse, error)
func (*StubAPI) RenameFile ¶
func (s *StubAPI) RenameFile(src, dst string) (models.RenamefileResponse, error)
func (*StubAPI) RenameFolder ¶
func (s *StubAPI) RenameFolder(src, dst string) (models.RenamefolderResponse, error)
Click to show internal directories.
Click to hide internal directories.