/*
  * Copyright 2026 Oleg Borodin <onborodin@gmail.com>
 *
 *
*/

package repocli

import (
	"github.com/stretchr/testify/require"

	"context"
	"fmt"
	"testing"
	"time"
)

func xxxTestClientManifestExists(t *testing.T) {
	rawrepo := "mirror.gcr.io/alpine"
	tags := []string{
		"3.20.0",
		"sha256:29e5ba63e79337818e6c63cfcc68e2ab4e9ca483853b2de303bfbfba9372426c",
	}
	for _, tag := range tags {

		cli := NewClient(nil, nil)
		ctx, _ := context.WithTimeout(context.Background(), 10*time.Second)
		exist, mime, size, csum, err := cli.ManifestExists(ctx, rawrepo+":"+tag)
		require.NoError(t, err)
		require.True(t, exist)

		fmt.Printf("MIME: %s\n", mime)
		fmt.Printf("Size: %d\n", size)
		fmt.Printf("Sum: %s\n", csum)
		//fmt.Printf("Typ: %d\n", DigestType(csum))
	}
}
