summaryrefslogtreecommitdiffstats
path: root/app/file_test.go
diff options
context:
space:
mode:
authorChris <ccbrown112@gmail.com>2017-09-06 17:12:54 -0500
committerGitHub <noreply@github.com>2017-09-06 17:12:54 -0500
commit1adfd0e9be69a93c7f63bb7afc742c9fafe31aa3 (patch)
tree2766bacc1f045fa685ca3d8310cd6174d0311d09 /app/file_test.go
parentb84bd21089d305333fa4114b95be70f5ad94ad1b (diff)
downloadchat-1adfd0e9be69a93c7f63bb7afc742c9fafe31aa3.tar.gz
chat-1adfd0e9be69a93c7f63bb7afc742c9fafe31aa3.tar.bz2
chat-1adfd0e9be69a93c7f63bb7afc742c9fafe31aa3.zip
app type transition (#7167)
Diffstat (limited to 'app/file_test.go')
-rw-r--r--app/file_test.go15
1 files changed, 8 insertions, 7 deletions
diff --git a/app/file_test.go b/app/file_test.go
index 962661039..52f42707c 100644
--- a/app/file_test.go
+++ b/app/file_test.go
@@ -36,7 +36,8 @@ func TestGeneratePublicLinkHash(t *testing.T) {
}
func TestDoUploadFile(t *testing.T) {
- Setup()
+ a := Global()
+ a.Setup()
teamId := model.NewId()
channelId := model.NewId()
@@ -44,12 +45,12 @@ func TestDoUploadFile(t *testing.T) {
filename := "test"
data := []byte("abcd")
- info1, err := DoUploadFile(time.Date(2007, 2, 4, 1, 2, 3, 4, time.Local), teamId, channelId, userId, filename, data)
+ info1, err := a.DoUploadFile(time.Date(2007, 2, 4, 1, 2, 3, 4, time.Local), teamId, channelId, userId, filename, data)
if err != nil {
t.Fatal(err)
} else {
defer func() {
- <-Srv.Store.FileInfo().PermanentDelete(info1.Id)
+ <-a.Srv.Store.FileInfo().PermanentDelete(info1.Id)
utils.RemoveFile(info1.Path)
}()
}
@@ -58,12 +59,12 @@ func TestDoUploadFile(t *testing.T) {
t.Fatal("stored file at incorrect path", info1.Path)
}
- info2, err := DoUploadFile(time.Date(2007, 2, 4, 1, 2, 3, 4, time.Local), teamId, channelId, userId, filename, data)
+ info2, err := a.DoUploadFile(time.Date(2007, 2, 4, 1, 2, 3, 4, time.Local), teamId, channelId, userId, filename, data)
if err != nil {
t.Fatal(err)
} else {
defer func() {
- <-Srv.Store.FileInfo().PermanentDelete(info2.Id)
+ <-a.Srv.Store.FileInfo().PermanentDelete(info2.Id)
utils.RemoveFile(info2.Path)
}()
}
@@ -72,12 +73,12 @@ func TestDoUploadFile(t *testing.T) {
t.Fatal("stored file at incorrect path", info2.Path)
}
- info3, err := DoUploadFile(time.Date(2008, 3, 5, 1, 2, 3, 4, time.Local), teamId, channelId, userId, filename, data)
+ info3, err := a.DoUploadFile(time.Date(2008, 3, 5, 1, 2, 3, 4, time.Local), teamId, channelId, userId, filename, data)
if err != nil {
t.Fatal(err)
} else {
defer func() {
- <-Srv.Store.FileInfo().PermanentDelete(info3.Id)
+ <-a.Srv.Store.FileInfo().PermanentDelete(info3.Id)
utils.RemoveFile(info3.Path)
}()
}