Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(256)

Unified Diff: client/isolatedclient/isolatedclient_test.go

Issue 1846263002: Isolate: Use generators instead of seekers (Closed) Base URL: https://github.com/luci/luci-go@master
Patch Set: Tweaks from comments. Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: client/isolatedclient/isolatedclient_test.go
diff --git a/client/isolatedclient/isolatedclient_test.go b/client/isolatedclient/isolatedclient_test.go
index e559434c33c2f1f3585307ffd74a0381bbd3f32d..aea20639775bbab0d7fb5b0e5bcfbb55d4e009c2 100644
--- a/client/isolatedclient/isolatedclient_test.go
+++ b/client/isolatedclient/isolatedclient_test.go
@@ -5,7 +5,6 @@
package isolatedclient
import (
- "bytes"
"io"
"log"
"math/rand"
@@ -78,7 +77,7 @@ func TestIsolateServerRetryGCSPartial(t *testing.T) {
ut.AssertEqual(t, nil, err)
ut.AssertEqual(t, len(digests), len(states))
for _, state := range states {
- err = client.Push(state, bytes.NewReader(contents[state.status.Index]))
+ err = client.Push(state, NewBytesSource(contents[state.status.Index]))
ut.AssertEqual(t, nil, err)
}
ut.AssertEqual(t, expected, server.Contents())
@@ -158,7 +157,7 @@ func testNormal(t *testing.T, contents ...[]byte) {
ut.AssertEqual(t, len(digests), len(states))
for _, state := range states {
// The data is automatically compressed.
- err = client.Push(state, bytes.NewReader(contents[state.status.Index]))
+ err = client.Push(state, NewBytesSource(contents[state.status.Index]))
ut.AssertEqual(t, nil, err)
}
ut.AssertEqual(t, nil, server.Error())
@@ -184,7 +183,7 @@ func testFlaky(t *testing.T, flake string) {
ut.AssertEqual(t, nil, err)
ut.AssertEqual(t, len(digests), len(states))
for _, state := range states {
- err = client.Push(state, bytes.NewReader(contents[state.status.Index]))
+ err = client.Push(state, NewBytesSource(contents[state.status.Index]))
ut.AssertEqual(t, nil, err)
}
ut.AssertEqual(t, expected, server.Contents())
« client/isolatedclient/isolatedclient.go ('K') | « client/isolatedclient/isolatedclient.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698