working commit

This commit is contained in:
2026-02-20 14:08:06 +02:00
parent 7dc6f9cb08
commit e2b3eaf6b8
3 changed files with 6 additions and 5 deletions
+3 -3
View File
@@ -18,7 +18,7 @@ import (
"mstore/app/server" "mstore/app/server"
"mstore/pkg/client" "mstore/pkg/client"
"mstore/pkg/descr" "mstore/pkg/terms"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
@@ -99,7 +99,7 @@ func TestAccountLife(t *testing.T) {
ctx := context.Background() ctx := context.Background()
ctx, _ = context.WithTimeout(ctx, 1*time.Second) ctx, _ = context.WithTimeout(ctx, 1*time.Second)
grantID, err = cli.CreateGrant(ctx, srvaddr, accountID, descr.RightReadAccounts, ".*") grantID, err = cli.CreateGrantByAccountID(ctx, srvaddr, accountID, terms.RightReadAccounts, ".*")
require.NoError(t, err) require.NoError(t, err)
require.Equal(t, len(grantID), 36) require.Equal(t, len(grantID), 36)
} }
@@ -120,7 +120,7 @@ func TestAccountLife(t *testing.T) {
ctx := context.Background() ctx := context.Background()
ctx, _ = context.WithTimeout(ctx, 1*time.Second) ctx, _ = context.WithTimeout(ctx, 1*time.Second)
grantID, err = cli.CreateGrant(ctx, srvaddr, accountID, descr.RightWriteAccounts, ".*") grantID, err = cli.CreateGrantByAccountID(ctx, srvaddr, accountID, terms.RightWriteAccounts, ".*")
require.NoError(t, err) require.NoError(t, err)
require.Equal(t, len(grantID), 36) require.Equal(t, len(grantID), 36)
fmt.Printf("grantID: %s\n", grantID) fmt.Printf("grantID: %s\n", grantID)
+2 -1
View File
@@ -21,6 +21,7 @@ import (
"mstore/app/server" "mstore/app/server"
"mstore/pkg/client" "mstore/pkg/client"
"mstore/pkg/terms"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
) )
@@ -132,7 +133,7 @@ func TestFileLife(t *testing.T) {
ctx := context.Background() ctx := context.Background()
ctx, _ = context.WithTimeout(ctx, 1*time.Second) ctx, _ = context.WithTimeout(ctx, 1*time.Second)
files, err := cli.ListFiles(ctx, srvaddr+"/") files, err := cli.ListFiles(ctx, srvaddr+"/", terms.AsFinePath)
require.NoError(t, err) require.NoError(t, err)
require.NotZero(t, len(files)) require.NotZero(t, len(files))
} }
+1 -1
View File
@@ -81,7 +81,7 @@ func TestImageLife(t *testing.T) {
fmt.Printf("=== PushImage ===\n") fmt.Printf("=== PushImage ===\n")
cli := client.NewClient() cli := client.NewClient()
ctx, _ := context.WithTimeout(context.Background(), 1*time.Second) ctx, _ := context.WithTimeout(context.Background(), 1*time.Second)
err := cli.PushImage(ctx, "test-oci.img", srvaddr+"/foo/test:123") err := cli.PushImage(ctx, "test-oci.tar", srvaddr+"/foo/test:123")
require.NoError(t, err) require.NoError(t, err)
} }
{ {