Files
mstore/pkg/repocli/pushimage_test.go
T
2026-03-31 14:40:25 +02:00

46 lines
853 B
Go

/*
* Copyright 2026 Oleg Borodin <onborodin@gmail.com>
*
*
*/
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, "test-oci", "localhost:1025/test:v1.0", "", "")
require.NoError(t, err)
}
{
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)
}
}