Files
mstore/pkg/repocli/pushimage_test.go
T
2026-03-10 22:09:57 +02:00

41 lines
796 B
Go

package repocli
import (
"github.com/stretchr/testify/require"
"context"
"testing"
"time"
)
func TestPushImage(t *testing.T) {
{
ctx, _ := context.WithTimeout(context.Background(), 10*time.Second)
mw := NewBasicAuthMiddleware("mstore", "mstore")
cli := NewClient(nil, mw)
require.NotNil(t, cli)
load := NewLoader(cli)
require.NotNil(t, load)
err := load.Push(ctx, "localhost:1025/test:v1.0", "test-oci", "", "")
require.NoError(t, err)
}
//return
{
ctx, _ := context.WithTimeout(context.Background(), 10*time.Second)
cli := NewClient(nil, nil)
require.NotNil(t, cli)
down := NewLoader(cli)
require.NotNil(t, down)
rawref := "localhost:1025/test:v1.0"
destdir := "aaa2"
err := down.Pull(ctx, rawref, destdir, "", "")
require.NoError(t, err)
}
}