working commit
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
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)
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user