Skip to content

Commit b737955

Browse files
[*] remove fmt.Println from webserver tests (#1218)
* test: replace fmt.Println with t.Log in webserver tests * fix tests --------- Co-authored-by: Pavlo Golub <pavlo.golub@gmail.com>
1 parent 98d166e commit b737955

1 file changed

Lines changed: 1 addition & 7 deletions

File tree

internal/webserver/server_test.go

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package webserver_test
22

33
import (
44
"context"
5-
"fmt"
65
"io"
76
"net/http"
87
"net/http/httptest"
@@ -110,7 +109,6 @@ func TestServerNoAuth(t *testing.T) {
110109
assert.NoError(t, err)
111110
restsrv.Handler.ServeHTTP(rr, reqConnect)
112111
assert.Equal(t, http.StatusUnauthorized, rr.Code, "REQUEST WITHOUT AUTHENTICATION")
113-
114112
}
115113

116114
func TestGetToken(t *testing.T) {
@@ -124,9 +122,7 @@ func TestGetToken(t *testing.T) {
124122
}
125123

126124
payload, err := jsoniter.ConfigFastest.Marshal(credentials)
127-
if err != nil {
128-
fmt.Println("Error marshaling ", err)
129-
}
125+
assert.NoError(t, err)
130126

131127
reqToken, err := http.NewRequest("POST", host+"/login", strings.NewReader(string(payload)))
132128
assert.Equal(t, err, nil)
@@ -136,8 +132,6 @@ func TestGetToken(t *testing.T) {
136132
assert.Equal(t, rr.Code, http.StatusOK, "TOKEN RESPONSE OK")
137133

138134
token, err := io.ReadAll(rr.Body)
139-
fmt.Println(string(token))
140135
assert.Equal(t, err, nil)
141136
assert.NotEqual(t, token, nil)
142-
143137
}

0 commit comments

Comments
 (0)