diff options
author | hmhealey <harrisonmhealey@gmail.com> | 2015-12-18 19:02:48 -0500 |
---|---|---|
committer | hmhealey <harrisonmhealey@gmail.com> | 2015-12-18 19:02:48 -0500 |
commit | cfdc5ab9998a86a8b540d8f5d5a7b429e919e4d6 (patch) | |
tree | 0f00aafc688e4216cc6c463313afcfe389ec628c /api | |
parent | 6288a1347e9870a5df8b3fee46066775d73367e5 (diff) | |
download | chat-cfdc5ab9998a86a8b540d8f5d5a7b429e919e4d6.tar.gz chat-cfdc5ab9998a86a8b540d8f5d5a7b429e919e4d6.tar.bz2 chat-cfdc5ab9998a86a8b540d8f5d5a7b429e919e4d6.zip |
Fixed TestGetFile unit test
Diffstat (limited to 'api')
-rw-r--r-- | api/file_test.go | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/api/file_test.go b/api/file_test.go index b5501e4bd..b3fbd2a27 100644 --- a/api/file_test.go +++ b/api/file_test.go @@ -152,7 +152,6 @@ func TestGetFile(t *testing.T) { channel1 = Client.Must(Client.CreateChannel(channel1)).Data.(*model.Channel) if utils.Cfg.FileSettings.DriverName != "" { - body := &bytes.Buffer{} writer := multipart.NewWriter(body) part, err := writer.CreateFormFile("files", "test.png") @@ -204,9 +203,9 @@ func TestGetFile(t *testing.T) { if resp, downErr := Client.GetFileInfo(filenames[0]); downErr != nil { t.Fatal(downErr) } else { - m := resp.Data.(map[string]string) - if len(m["size"]) == 0 { - t.Fail() + info := resp.Data.(*model.FileInfo) + if info.Size == 0 { + t.Fatal("No file size returned") } } |