"net"
"net/http"
"os"
+ "strings"
"testing"
)
kc.Retries = 0
r, n, url2, err := kc.Get(hash)
- c.Check(err, Equals, BlockNotFound)
+ errNotFound, _ := err.(ErrNotFound)
+ c.Check(errNotFound, NotNil)
+ c.Check(strings.Contains(err.Error(), "use of closed network connection"), Equals, true)
c.Check(n, Equals, int64(0))
c.Check(url2, Equals, "")
c.Check(r, Equals, nil)
kc.SetServiceRoots(map[string]string{"x": "http://localhost:62222"}, nil, nil)
r, n, url2, err := kc.Get(hash)
- c.Check(err, Equals, BlockNotFound)
+ errNotFound, _ := err.(ErrNotFound)
+ c.Check(errNotFound, NotNil)
+ c.Check(strings.Contains(err.Error(), "connection refused"), Equals, true)
c.Check(n, Equals, int64(0))
c.Check(url2, Equals, "")
c.Check(r, Equals, nil)