Files
ziti/router/handler_ctrl/timeout_check_test.go
T
2024-03-01 14:06:36 -05:00

31 lines
509 B
Go

package handler_ctrl
import (
"fmt"
"github.com/stretchr/testify/assert"
"testing"
)
type testTimeoutErr struct{}
func (t testTimeoutErr) Error() string {
return "test"
}
func (t testTimeoutErr) Timeout() bool {
return true
}
func (t testTimeoutErr) Temporary() bool {
return true
}
func Test_TimeoutCheck(t *testing.T) {
err := testTimeoutErr{}
req := assert.New(t)
req.True(isNetworkTimeout(err))
wrapped := fmt.Errorf("there was an error (%w)", err)
req.True(isNetworkTimeout(wrapped))
}