(t *testing.T)
| 128 | } |
| 129 | |
| 130 | func TestSplitHTTP200ResponseToPartial(t *testing.T) { |
| 131 | body := io.NopCloser(bytes.NewReader([]byte("123456789"))) |
| 132 | defer body.Close() |
| 133 | streams := make(chan io.ReadCloser) |
| 134 | errs := make(chan error) |
| 135 | chunks := []private.ImageSourceChunk{ |
| 136 | {Offset: 1, Length: 2}, |
| 137 | {Offset: 4, Length: 1}, |
| 138 | } |
| 139 | go splitHTTP200ResponseToPartial(streams, errs, body, chunks) |
| 140 | |
| 141 | expected := []verifyGetBlobAtData{ |
| 142 | {[]byte("23"), nil}, |
| 143 | {[]byte("5"), nil}, |
| 144 | {[]byte(nil), nil}, |
| 145 | } |
| 146 | |
| 147 | verifyGetBlobAtOutput(t, streams, errs, expected) |
| 148 | } |
| 149 | |
| 150 | func TestHandle206Response(t *testing.T) { |
| 151 | body := io.NopCloser(bytes.NewReader([]byte("--AAA\r\n\r\n23\r\n--AAA\r\n\r\n5\r\n--AAA--"))) |
nothing calls this directly
no test coverage detected
searching dependent graphs…