working commit
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
package repocli
|
||||
|
||||
import (
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"bytes"
|
||||
"context"
|
||||
"fmt"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
func xxxTestClientGetBlob(t *testing.T) {
|
||||
rawrepos := []string{
|
||||
"mirror.gcr.io/alpine",
|
||||
}
|
||||
for _, rawrepo := range rawrepos {
|
||||
cli := NewClient()
|
||||
ctx, _ := context.WithTimeout(context.Background(), 10*time.Second)
|
||||
buffer := bytes.NewBuffer(nil)
|
||||
digstr := "sha256:3b8747b05489980f63da1d2b8e5a444c55777f69540394397b0bc1c76c3e41f2"
|
||||
exist, err := cli.GetBlob(ctx, rawrepo, buffer, digstr)
|
||||
require.NoError(t, err)
|
||||
require.True(t, exist)
|
||||
fmt.Printf("Size: %d\n", len(buffer.Bytes()))
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user