Merge branch 'master' into 7492-keepproxy-upstream-errors
[arvados.git] / sdk / go / keepclient / keepclient_test.go
index c03ba90736868d15cdba09d0638e160e60d57998..ddfb20ec75a4485e3753779851ae91bcd93a0150 100644 (file)
@@ -14,6 +14,7 @@ import (
        "net"
        "net/http"
        "os"
+       "strings"
        "testing"
 )
 
@@ -556,7 +557,9 @@ func (s *StandaloneSuite) TestGetFail(c *C) {
        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)
@@ -601,7 +604,9 @@ func (s *StandaloneSuite) TestGetNetError(c *C) {
        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)