test: add tests for errors

This commit is contained in:
mehanizm
2020-04-17 23:12:07 +03:00
parent bc37bb1eb4
commit 4630f5f396
4 changed files with 38 additions and 7 deletions

22
errors_test.go Normal file
View File

@@ -0,0 +1,22 @@
// Copyright © 2020 Mike Berezin
//
// Use of this source code is governed by an MIT license.
// Details in the LICENSE file.
package airtable
import (
"errors"
"testing"
)
func TestHTTPClientError_Error(t *testing.T) {
e := &HTTPClientError{
StatusCode: 300,
Err: errors.New("error message"),
}
expected := "status 300, err: error message"
if got := e.Error(); got != expected {
t.Errorf("HTTPClientError.Error() = %v, want %v", got, expected)
}
}