Tests the streaming of all blobs in a storage, with hash verification.
(t *testing.T)
| 154 | |
| 155 | // Tests the streaming of all blobs in a storage, with hash verification. |
| 156 | func TestBasicStreaming(t *testing.T) { |
| 157 | s, clean := newTestStorage(t, pack{testPack1}) |
| 158 | defer clean() |
| 159 | |
| 160 | expected := len(testPack1) |
| 161 | blobs := streamAll(t, s) |
| 162 | if len(blobs) != expected { |
| 163 | t.Fatalf("Wrong blob count: Expected %d, got %d", expected, |
| 164 | len(blobs)) |
| 165 | } |
| 166 | wantRefs := make([]blob.SizedRef, len(blobs)) |
| 167 | for i, b := range blobs { |
| 168 | wantRefs[i] = b.SizedRef() |
| 169 | } |
| 170 | storagetest.TestStreamer(t, s, storagetest.WantSizedRefs(wantRefs)) |
| 171 | } |
| 172 | |
| 173 | func verifySizeAndHash(t *testing.T, blob *blob.Blob) { |
| 174 | hash := sha1.New() |
nothing calls this directly
no test coverage detected