Files
gateway-telegram/test/testutil/fake_file_downloader.go

26 lines
513 B
Go

package testutil
import "context"
type FakeFileDownloader struct {
Data []byte
MimeType string
Error error
}
func (f *FakeFileDownloader) Download(_ context.Context, _ string) ([]byte, string, error) {
return f.Data, f.MimeType, f.Error
}
type FakeAudioConverter struct {
Output []byte
Error error
}
func (f *FakeAudioConverter) Convert(_ context.Context, _ []byte, _, _ string) ([]byte, error) {
if f.Output != nil {
return f.Output, f.Error
}
return []byte("converted-audio"), f.Error
}