diff options
| author | Shulhan <ms@kilabit.info> | 2023-12-10 03:23:02 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2023-12-14 20:23:47 +0700 |
| commit | f1bcd6e27e9cbf541b9f6d76944bb491aede370a (patch) | |
| tree | 7349319155d7f8321afc9df08c3ed4ef71bbfcea /http_server_test.go | |
| parent | 87b79dbd1da7acc73456b3fbfe59a40b59bf116f (diff) | |
| download | awwan-f1bcd6e27e9cbf541b9f6d76944bb491aede370a.tar.xz | |
all: changes based on reports from linter revive
Better to fix and follow the reported warnings rather than adding
configuration file to add an exception.
Diffstat (limited to 'http_server_test.go')
| -rw-r--r-- | http_server_test.go | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/http_server_test.go b/http_server_test.go index 7dcff3f..9a7603f 100644 --- a/http_server_test.go +++ b/http_server_test.go @@ -49,14 +49,14 @@ func TestHttpServer_Decrypt(t *testing.T) { var httpd *httpServer - httpd, err = newHttpServer(aww, ``) + httpd, err = newHTTPServer(aww, ``) if err != nil { t.Fatal(err) } var endpointDecrypt = &libhttp.Endpoint{ Method: libhttp.RequestMethodPost, - Path: pathAwwanApiDecrypt, + Path: pathAwwanAPIDecrypt, RequestType: libhttp.RequestTypeJSON, ResponseType: libhttp.ResponseTypeJSON, } @@ -137,14 +137,14 @@ func TestHttpServer_Encrypt(t *testing.T) { var httpd *httpServer - httpd, err = newHttpServer(aww, ``) + httpd, err = newHTTPServer(aww, ``) if err != nil { t.Fatal(err) } var endpointEncrypt = &libhttp.Endpoint{ Method: libhttp.RequestMethodPost, - Path: pathAwwanApiEncrypt, + Path: pathAwwanAPIEncrypt, RequestType: libhttp.RequestTypeJSON, ResponseType: libhttp.ResponseTypeJSON, } @@ -239,7 +239,7 @@ func TestHttpServer_Execute(t *testing.T) { clientOpts = libhttp.ClientOptions{ ServerUrl: fmt.Sprintf(`http://%s`, address), } - reqJson = tdata.Input[`local:/local.aww:1-`] + reqJSON = tdata.Input[`local:/local.aww:1-`] execRequest ExecRequest cl *libhttp.Client @@ -247,7 +247,7 @@ func TestHttpServer_Execute(t *testing.T) { cl = libhttp.NewClient(&clientOpts) - err = json.Unmarshal(reqJson, &execRequest) + err = json.Unmarshal(reqJSON, &execRequest) if err != nil { t.Fatal(err) } @@ -257,7 +257,7 @@ func TestHttpServer_Execute(t *testing.T) { buf bytes.Buffer ) - _, resBody, err = cl.PostJSON(pathAwwanApiExecute, nil, &execRequest) + _, resBody, err = cl.PostJSON(pathAwwanAPIExecute, nil, &execRequest) if err != nil { t.Fatal(err) } @@ -283,7 +283,7 @@ func TestHttpServer_Execute(t *testing.T) { // Tail the execution output. var ssec = sseclient.Client{ - Endpoint: fmt.Sprintf(`http://%s%s?id=%s`, address, pathAwwanApiExecuteTail, execResp.ID), + Endpoint: fmt.Sprintf(`http://%s%s?id=%s`, address, pathAwwanAPIExecuteTail, execResp.ID), } err = ssec.Connect(nil) @@ -344,7 +344,7 @@ func TestHttpServer_FSGet(t *testing.T) { var httpd *httpServer - httpd, err = newHttpServer(aww, ``) + httpd, err = newHTTPServer(aww, ``) if err != nil { t.Fatal(err) } @@ -380,7 +380,7 @@ func TestHttpServer_FSGet(t *testing.T) { for _, c = range cases { t.Log(c.desc) - httpReq = httptest.NewRequest(http.MethodGet, pathAwwanApiFs+`?path=`+c.path, nil) + httpReq = httptest.NewRequest(http.MethodGet, pathAwwanAPIFs+`?path=`+c.path, nil) httpWriter = httptest.NewRecorder() |
