Skip to content

Commit

Permalink
Move docker/tarfile/src_test.go to docker/internal/tarfile
Browse files Browse the repository at this point in the history
, closer to the implementation being tested.

Signed-off-by: Miloslav Trmač <[email protected]>
  • Loading branch information
mtrmac committed Aug 6, 2020
1 parent 72b39c5 commit cb6958c
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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.Close()
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{
Expand Down

0 comments on commit cb6958c

Please sign in to comment.