diff options
author | Wolfy-J <[email protected]> | 2018-06-14 22:56:19 +0300 |
---|---|---|
committer | Wolfy-J <[email protected]> | 2018-06-14 22:56:19 +0300 |
commit | 082c329d9dc84453a02693119d954f60a4792b11 (patch) | |
tree | a2e2279576c84a157c278869ee84d9f8f42b7c20 /service/http/uploads_test.go | |
parent | 5fef5b06e6261bc7c133380ef8b5bc8e63ac9fbe (diff) |
fmt
Diffstat (limited to 'service/http/uploads_test.go')
-rw-r--r-- | service/http/uploads_test.go | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/service/http/uploads_test.go b/service/http/uploads_test.go index af351067..b2662bf7 100644 --- a/service/http/uploads_test.go +++ b/service/http/uploads_test.go @@ -1,20 +1,20 @@ package http import ( - "github.com/spiral/roadrunner" - "github.com/stretchr/testify/assert" - "net/http" - "time" "bytes" - "mime/multipart" - "io/ioutil" - "testing" - "os" "context" - "io" - "encoding/json" "crypto/md5" "encoding/hex" + "encoding/json" + "github.com/spiral/roadrunner" + "github.com/stretchr/testify/assert" + "io" + "io/ioutil" + "mime/multipart" + "net/http" + "os" + "testing" + "time" ) func TestServer_Upload_File(t *testing.T) { @@ -40,7 +40,7 @@ func TestServer_Upload_File(t *testing.T) { assert.NoError(t, st.rr.Start()) defer st.rr.Stop() - hs := &http.Server{Addr: ":8021", Handler: st,} + hs := &http.Server{Addr: ":8021", Handler: st} defer hs.Shutdown(context.Background()) go func() { hs.ListenAndServe() }() @@ -101,7 +101,7 @@ func TestServer_Upload_NestedFile(t *testing.T) { assert.NoError(t, st.rr.Start()) defer st.rr.Stop() - hs := &http.Server{Addr: ":8021", Handler: st,} + hs := &http.Server{Addr: ":8021", Handler: st} defer hs.Shutdown(context.Background()) go func() { hs.ListenAndServe() }() @@ -139,7 +139,6 @@ func TestServer_Upload_NestedFile(t *testing.T) { assert.Equal(t, `{"upload":{"x":{"y":{"z":[`+fs+`]}}}}`, string(b)) } - func TestServer_Upload_File_NoTmpDir(t *testing.T) { st := &Handler{ cfg: &Config{ @@ -163,7 +162,7 @@ func TestServer_Upload_File_NoTmpDir(t *testing.T) { assert.NoError(t, st.rr.Start()) defer st.rr.Stop() - hs := &http.Server{Addr: ":8021", Handler: st,} + hs := &http.Server{Addr: ":8021", Handler: st} defer hs.Shutdown(context.Background()) go func() { hs.ListenAndServe() }() @@ -201,7 +200,6 @@ func TestServer_Upload_File_NoTmpDir(t *testing.T) { assert.Equal(t, `{"upload":`+fs+`}`, string(b)) } - func TestServer_Upload_File_Forbids(t *testing.T) { st := &Handler{ cfg: &Config{ @@ -225,7 +223,7 @@ func TestServer_Upload_File_Forbids(t *testing.T) { assert.NoError(t, st.rr.Start()) defer st.rr.Stop() - hs := &http.Server{Addr: ":8021", Handler: st,} + hs := &http.Server{Addr: ":8021", Handler: st} defer hs.Shutdown(context.Background()) go func() { hs.ListenAndServe() }() |