diff options
Diffstat (limited to 'service/http/uploads_test.go')
-rw-r--r-- | service/http/uploads_test.go | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/service/http/uploads_test.go b/service/http/uploads_test.go index 96e95733..d452f834 100644 --- a/service/http/uploads_test.go +++ b/service/http/uploads_test.go @@ -17,8 +17,8 @@ import ( "time" ) -func TestServer_Upload_File(t *testing.T) { - st := &Handler{ +func TestHandler_Upload_File(t *testing.T) { + h := &Handler{ cfg: &Config{ MaxRequest: 1024, Uploads: &UploadsConfig{ @@ -37,10 +37,10 @@ func TestServer_Upload_File(t *testing.T) { }), } - assert.NoError(t, st.rr.Start()) - defer st.rr.Stop() + assert.NoError(t, h.rr.Start()) + defer h.rr.Stop() - hs := &http.Server{Addr: ":8021", Handler: st} + hs := &http.Server{Addr: ":8021", Handler: h} defer hs.Shutdown(context.Background()) go func() { hs.ListenAndServe() }() @@ -78,8 +78,8 @@ func TestServer_Upload_File(t *testing.T) { assert.Equal(t, `{"upload":`+fs+`}`, string(b)) } -func TestServer_Upload_NestedFile(t *testing.T) { - st := &Handler{ +func TestHandler_Upload_NestedFile(t *testing.T) { + h := &Handler{ cfg: &Config{ MaxRequest: 1024, Uploads: &UploadsConfig{ @@ -98,10 +98,10 @@ func TestServer_Upload_NestedFile(t *testing.T) { }), } - assert.NoError(t, st.rr.Start()) - defer st.rr.Stop() + assert.NoError(t, h.rr.Start()) + defer h.rr.Stop() - hs := &http.Server{Addr: ":8021", Handler: st} + hs := &http.Server{Addr: ":8021", Handler: h} defer hs.Shutdown(context.Background()) go func() { hs.ListenAndServe() }() @@ -139,8 +139,8 @@ 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{ +func TestHandler_Upload_File_NoTmpDir(t *testing.T) { + h := &Handler{ cfg: &Config{ MaxRequest: 1024, Uploads: &UploadsConfig{ @@ -159,10 +159,10 @@ func TestServer_Upload_File_NoTmpDir(t *testing.T) { }), } - assert.NoError(t, st.rr.Start()) - defer st.rr.Stop() + assert.NoError(t, h.rr.Start()) + defer h.rr.Stop() - hs := &http.Server{Addr: ":8021", Handler: st} + hs := &http.Server{Addr: ":8021", Handler: h} defer hs.Shutdown(context.Background()) go func() { hs.ListenAndServe() }() @@ -200,8 +200,8 @@ 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{ +func TestHandler_Upload_File_Forbids(t *testing.T) { + h := &Handler{ cfg: &Config{ MaxRequest: 1024, Uploads: &UploadsConfig{ @@ -220,10 +220,10 @@ func TestServer_Upload_File_Forbids(t *testing.T) { }), } - assert.NoError(t, st.rr.Start()) - defer st.rr.Stop() + assert.NoError(t, h.rr.Start()) + defer h.rr.Stop() - hs := &http.Server{Addr: ":8021", Handler: st} + hs := &http.Server{Addr: ":8021", Handler: h} defer hs.Shutdown(context.Background()) go func() { hs.ListenAndServe() }() |