package repocli

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

	"fmt"
	"testing"

	"mstore/pkg/digest"
)

func xxxTestResrerer(t *testing.T) {
	ref, err := NewReferer("registry.example.com/lib/alpine:3.30.0")
	require.NoError(t, err)

	fmt.Printf("Manifest:\t%s\n", ref.ManifestEP())

	digobj := digest.NewDigest(digest.SHA256, []byte("qwerty"))
	fmt.Printf("Blob:\t\t%s\n", ref.BlobEP(digobj.Encoded()))
	fmt.Printf("POST:\t\t%s\n", ref.UploadEP())
	uuid := "8be4df61-93ca-11d2-aa0d-00e098032b8c"
	rawurl, err := ref.PatchEP(uuid)
	require.NoError(t, err)
	fmt.Printf("PATH:\t\t%s\n", rawurl)
	rawurl, err = ref.PutEP(uuid, digobj.Encoded())
	fmt.Printf("PUT:\t\t%s\n", rawurl)
}
