diff options
author | Vitaly V <vvelikodny@gmail.com> | 2017-12-13 02:12:32 +0800 |
---|---|---|
committer | Felix Lange <fjl@users.noreply.github.com> | 2017-12-13 02:12:32 +0800 |
commit | f258a21a63347a43a80d7834beb39f276a328ba6 (patch) | |
tree | bd48f609b050429650b79e596a4caf176bb9bec4 /rpc/http_test.go | |
parent | fd777bb2104f15cb7c2f7eede7069ad436e29b57 (diff) | |
download | dexon-f258a21a63347a43a80d7834beb39f276a328ba6.tar dexon-f258a21a63347a43a80d7834beb39f276a328ba6.tar.gz dexon-f258a21a63347a43a80d7834beb39f276a328ba6.tar.bz2 dexon-f258a21a63347a43a80d7834beb39f276a328ba6.tar.lz dexon-f258a21a63347a43a80d7834beb39f276a328ba6.tar.xz dexon-f258a21a63347a43a80d7834beb39f276a328ba6.tar.zst dexon-f258a21a63347a43a80d7834beb39f276a328ba6.zip |
rpc: use method constants instead of literal strings (#15652)
Diffstat (limited to 'rpc/http_test.go')
-rw-r--r-- | rpc/http_test.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/rpc/http_test.go b/rpc/http_test.go index 38196b48b..aed84f683 100644 --- a/rpc/http_test.go +++ b/rpc/http_test.go @@ -24,25 +24,25 @@ import ( ) func TestHTTPErrorResponseWithDelete(t *testing.T) { - testHTTPErrorResponse(t, "DELETE", contentType, "", http.StatusMethodNotAllowed) + testHTTPErrorResponse(t, http.MethodDelete, contentType, "", http.StatusMethodNotAllowed) } func TestHTTPErrorResponseWithPut(t *testing.T) { - testHTTPErrorResponse(t, "PUT", contentType, "", http.StatusMethodNotAllowed) + testHTTPErrorResponse(t, http.MethodPut, contentType, "", http.StatusMethodNotAllowed) } func TestHTTPErrorResponseWithMaxContentLength(t *testing.T) { body := make([]rune, maxHTTPRequestContentLength+1) testHTTPErrorResponse(t, - "POST", contentType, string(body), http.StatusRequestEntityTooLarge) + http.MethodPost, contentType, string(body), http.StatusRequestEntityTooLarge) } func TestHTTPErrorResponseWithEmptyContentType(t *testing.T) { - testHTTPErrorResponse(t, "POST", "", "", http.StatusUnsupportedMediaType) + testHTTPErrorResponse(t, http.MethodPost, "", "", http.StatusUnsupportedMediaType) } func TestHTTPErrorResponseWithValidRequest(t *testing.T) { - testHTTPErrorResponse(t, "POST", contentType, "", 0) + testHTTPErrorResponse(t, http.MethodPost, contentType, "", 0) } func testHTTPErrorResponse(t *testing.T, method, contentType, body string, expected int) { |