Update vendored dependencies

This includes github.com/kurin/blazer 0.2.0, which resolves #1291
This commit is contained in:
Alexander Neumann 2017-10-01 10:13:39 +02:00
parent ba23d24dd1
commit 61cb1cc6f8
1044 changed files with 203022 additions and 97709 deletions

View file

@ -33,6 +33,7 @@ import (
type fakeTransport struct {
gotReq *http.Request
gotBody []byte
results []transportResult
}
@ -47,6 +48,14 @@ func (t *fakeTransport) addResult(res *http.Response, err error) {
func (t *fakeTransport) RoundTrip(req *http.Request) (*http.Response, error) {
t.gotReq = req
t.gotBody = nil
if req.Body != nil {
bytes, err := ioutil.ReadAll(req.Body)
if err != nil {
return nil, err
}
t.gotBody = bytes
}
if len(t.results) == 0 {
return nil, fmt.Errorf("error handling request")
}
@ -58,6 +67,7 @@ func (t *fakeTransport) RoundTrip(req *http.Request) (*http.Response, error) {
func TestErrorOnObjectsInsertCall(t *testing.T) {
t.Parallel()
ctx := context.Background()
const contents = "hello world"
doWrite := func(hc *http.Client) *Writer {
client, err := NewClient(ctx, option.WithHTTPClient(hc))
@ -69,7 +79,7 @@ func TestErrorOnObjectsInsertCall(t *testing.T) {
// We can't check that the Write fails, since it depends on the write to the
// underling fakeTransport failing which is racy.
wc.Write([]byte("hello world"))
wc.Write([]byte(contents))
return wc
}
@ -94,6 +104,10 @@ func TestErrorOnObjectsInsertCall(t *testing.T) {
if err := wc.Close(); err != nil {
t.Errorf("got %v, want nil", err)
}
got := string(ft.gotBody)
if !strings.Contains(got, contents) {
t.Errorf("got body %q, which does not contain %q", got, contents)
}
}
func TestEncryption(t *testing.T) {