feat: initial commit
This commit is contained in:
25
test/testutil/fake_file_downloader.go
Normal file
25
test/testutil/fake_file_downloader.go
Normal file
@@ -0,0 +1,25 @@
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user