36 lines
881 B
Go
36 lines
881 B
Go
/*
|
|
* Copyright 2026 Oleg Borodin <onborodin@gmail.com>
|
|
*
|
|
* This work is published and licensed under a Creative Commons
|
|
* Attribution-NonCommercial-NoDerivatives 4.0 International License.
|
|
*
|
|
* Distribution of this work is permitted, but commercial use and
|
|
* modifications are strictly prohibited.
|
|
*/
|
|
package repocli
|
|
|
|
import (
|
|
"github.com/stretchr/testify/require"
|
|
|
|
"context"
|
|
"fmt"
|
|
"testing"
|
|
"time"
|
|
)
|
|
|
|
func xxxTestClientBlobExists(t *testing.T) {
|
|
rawrepos := []string{
|
|
"mirror.gcr.io/alpine",
|
|
}
|
|
for _, rawrepo := range rawrepos {
|
|
cli := NewClient(nil, nil)
|
|
ctx, _ := context.WithTimeout(context.Background(), 10*time.Second)
|
|
digstr := "sha256:3b8747b05489980f63da1d2b8e5a444c55777f69540394397b0bc1c76c3e41f2"
|
|
exist, size, err := cli.BlobExists(ctx, rawrepo, digstr)
|
|
require.NoError(t, err)
|
|
require.True(t, exist)
|
|
|
|
fmt.Printf("Size: %d\n", size)
|
|
}
|
|
}
|