summaryrefslogtreecommitdiffstats
path: root/api4/file_test.go
diff options
context:
space:
mode:
authorHarrison Healey <harrisonmhealey@gmail.com>2017-07-20 04:42:52 -0400
committerGeorge Goldberg <george@gberg.me>2017-07-20 09:42:52 +0100
commit59e4ecd09faaf2c4034978768f69fdef5ef1d2b1 (patch)
tree56d7a9677eb3c44e3d2bf4d598c81c12f8bed2b7 /api4/file_test.go
parent5f8a93fca66215d5c6a16297cfb649ce15526044 (diff)
downloadchat-59e4ecd09faaf2c4034978768f69fdef5ef1d2b1.tar.gz
chat-59e4ecd09faaf2c4034978768f69fdef5ef1d2b1.tar.bz2
chat-59e4ecd09faaf2c4034978768f69fdef5ef1d2b1.zip
PLT-6760 Allowed TestUploadFile to pass when http client errors (#6985)
Diffstat (limited to 'api4/file_test.go')
-rw-r--r--api4/file_test.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/api4/file_test.go b/api4/file_test.go
index e48aabffc..92f275d85 100644
--- a/api4/file_test.go
+++ b/api4/file_test.go
@@ -110,7 +110,10 @@ func TestUploadFile(t *testing.T) {
*utils.Cfg.FileSettings.EnableFileAttachments = false
_, resp = th.SystemAdminClient.UploadFile(data, channel.Id, "test.png")
- CheckNotImplementedStatus(t, resp)
+ if resp.StatusCode != http.StatusNotImplemented && resp.StatusCode != 0 {
+ // This should return an HTTP 501, but it occasionally causes the http client itself to error
+ t.Fatalf("should've returned HTTP 501 or failed completely, got %v instead", resp.StatusCode)
+ }
}
func TestGetFile(t *testing.T) {