(t *testing.T)
| 10 | ) |
| 11 | |
| 12 | func TestClient_FormatError(t *testing.T) { |
| 13 | e := &errorInfo{ |
| 14 | Response: &http.Response{ |
| 15 | StatusCode: 401, |
| 16 | Status: "401 Not Found", |
| 17 | }, |
| 18 | } |
| 19 | |
| 20 | err := FormatError("action", e) |
| 21 | assert.Equal(t, "Error action: Not Found (HTTP 401)", fmt.Sprintf("%s", err)) |
| 22 | |
| 23 | e = &errorInfo{ |
| 24 | Response: &http.Response{ |
| 25 | StatusCode: 422, |
| 26 | Status: "422 Unprocessable Entity", |
| 27 | }, |
| 28 | Message: "error message", |
| 29 | } |
| 30 | err = FormatError("action", e) |
| 31 | assert.Equal(t, "Error action: Unprocessable Entity (HTTP 422)\nerror message", fmt.Sprintf("%s", err)) |
| 32 | } |
| 33 | |
| 34 | func TestAuthTokenNote(t *testing.T) { |
| 35 | note, err := authTokenNote(1) |
nothing calls this directly
no test coverage detected
searching dependent graphs…