Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
Signed-off-by: Fabrizio Sestito <[email protected]>
  • Loading branch information
fabriziosestito committed Nov 6, 2024
1 parent f36956f commit 901b365
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions internal/handlers/create_catalog_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,24 @@ import (
"testing"
"time"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
"github.com/stretchr/testify/require"

"go.uber.org/zap"

"github.com/google/go-containerregistry/pkg/name"
cranev1 "github.com/google/go-containerregistry/pkg/v1"
"github.com/google/go-containerregistry/pkg/v1/types"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"sigs.k8s.io/controller-runtime/pkg/client/fake"

"github.com/rancher/sbombastic/api/v1alpha1"
"github.com/rancher/sbombastic/internal/handlers/registry"
registryclient "github.com/rancher/sbombastic/internal/handlers/registry"
"github.com/rancher/sbombastic/internal/handlers/registry/mocks"
registryMocks "github.com/rancher/sbombastic/internal/handlers/registry/mocks"
"github.com/rancher/sbombastic/internal/messaging"
"github.com/rancher/sbombastic/pkg/generated/clientset/versioned/scheme"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
"github.com/stretchr/testify/require"
"go.uber.org/zap"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"sigs.k8s.io/controller-runtime/pkg/client/fake"
)

func TestCreateCatalogHandler_Handle(t *testing.T) {
Expand Down Expand Up @@ -83,7 +85,7 @@ func TestCreateCatalogHandler_Handle(t *testing.T) {
},
}

imageIndex := mocks.NewImageIndex(t)
imageIndex := registryMocks.NewImageIndex(t)
imageIndex.On("IndexManifest").Return(&indexManifest, nil)

mockRegistryClient.On("GetImageIndex", image).Return(imageIndex, nil)
Expand All @@ -97,7 +99,7 @@ func TestCreateCatalogHandler_Handle(t *testing.T) {
mockRegistryClient.On("GetImageDetails", image, &platformLinuxAmd64).Return(imageDetailsLinuxAmd64, nil)
mockRegistryClient.On("GetImageDetails", image, &platformLinuxArm64).Return(imageDetailsLinuxArm64, nil)

mockRegistryClientFactory := func(_ http.RoundTripper) registryclient.Client { return mockRegistryClient }
mockRegistryClientFactory := func(_ http.RoundTripper) registry.Client { return mockRegistryClient }

registry := &v1alpha1.Registry{
ObjectMeta: metav1.ObjectMeta{
Expand Down

0 comments on commit 901b365

Please sign in to comment.