diff options
author | Jesse Hallam <jesse.hallam@gmail.com> | 2018-05-10 18:16:33 -0400 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2018-05-10 15:16:33 -0700 |
commit | 2b27e12445ba51e1fa1ab2aceac5fcb3de66845d (patch) | |
tree | 3d3bf61a39534e8db4cffde9b9644c3ce895580c /utils/mail_test.go | |
parent | 7fa1c6c4bae19d1647d759198126ee4591282079 (diff) | |
download | chat-2b27e12445ba51e1fa1ab2aceac5fcb3de66845d.tar.gz chat-2b27e12445ba51e1fa1ab2aceac5fcb3de66845d.tar.bz2 chat-2b27e12445ba51e1fa1ab2aceac5fcb3de66845d.zip |
MM-10188: expect io.Reader in FileBackend.WriteFile (#8765)
This is a reworked set of changes originally from @josephGuo to begin
reducing the duplicated memory required when uploading files.
Diffstat (limited to 'utils/mail_test.go')
-rw-r--r-- | utils/mail_test.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/utils/mail_test.go b/utils/mail_test.go index 6bd8e7044..22a50df5f 100644 --- a/utils/mail_test.go +++ b/utils/mail_test.go @@ -150,8 +150,10 @@ func TestSendMailUsingConfig(t *testing.T) { filePath2 := fmt.Sprintf("test2/%s", fileName) fileContents1 := []byte("hello world") fileContents2 := []byte("foo bar") - assert.Nil(t, fileBackend.WriteFile(fileContents1, filePath1)) - assert.Nil(t, fileBackend.WriteFile(fileContents2, filePath2)) + _, err := fileBackend.WriteFile(bytes.NewReader(fileContents1), filePath1) + assert.Nil(t, err) + _, err := fileBackend.WriteFile(bytes.NewReader(fileContents2), filePath2) + assert.Nil(t, err) defer fileBackend.RemoveFile(filePath1) defer fileBackend.RemoveFile(filePath2) |