From 569764057fa8e08875d957f685d807dac4ef26cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miloslav=20Trma=C4=8D?= Date: Wed, 29 Jul 2020 22:27:06 +0200 Subject: [PATCH] Move docker/tarfile/src_test.go to docker/internal/tarfile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit , closer to the implementation being tested. Signed-off-by: Miloslav Trmač --- docker/{ => internal}/tarfile/src_test.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) rename docker/{ => internal}/tarfile/src_test.go (87%) diff --git a/docker/tarfile/src_test.go b/docker/internal/tarfile/src_test.go similarity index 87% rename from docker/tarfile/src_test.go rename to docker/internal/tarfile/src_test.go index 8b22aa5aff..fe501c0c66 100644 --- a/docker/tarfile/src_test.go +++ b/docker/internal/tarfile/src_test.go @@ -26,7 +26,8 @@ func TestSourcePrepareLayerData(t *testing.T) { var tarfileBuffer bytes.Buffer ctx := context.Background() - dest := NewDestinationWithContext(nil, &tarfileBuffer, nil) + writer := NewWriter(&tarfileBuffer) + dest := NewDestination(nil, writer, nil) // No layers configInfo, err := dest.PutBlob(ctx, bytes.NewBufferString(c.config), types.BlobInfo{Size: -1}, cache, true) @@ -40,10 +41,12 @@ func TestSourcePrepareLayerData(t *testing.T) { require.NoError(t, err, c.config) err = dest.PutManifest(ctx, manifest, nil) require.NoError(t, err, c.config) - err = dest.Commit(ctx) + err = writer.Finish() require.NoError(t, err, c.config) - src, err := NewSourceFromStreamWithSystemContext(nil, &tarfileBuffer) + reader, err := NewReaderFromStream(nil, &tarfileBuffer) + require.NoError(t, err, c.config) + src := NewSource(reader, true, nil, -1) require.NoError(t, err, c.config) defer src.Close() configStream, _, err := src.GetBlob(ctx, types.BlobInfo{