github.com/weaviate/weaviate@v1.24.6/modules/ref2vec-centroid/vectorizer/fakes_for_test.go (about)

     1  //                           _       _
     2  // __      _____  __ ___   ___  __ _| |_ ___
     3  // \ \ /\ / / _ \/ _` \ \ / / |/ _` | __/ _ \
     4  //  \ V  V /  __/ (_| |\ V /| | (_| | ||  __/
     5  //   \_/\_/ \___|\__,_| \_/ |_|\__,_|\__\___|
     6  //
     7  //  Copyright © 2016 - 2024 Weaviate B.V. All rights reserved.
     8  //
     9  //  CONTACT: hello@weaviate.io
    10  //
    11  
    12  package vectorizer
    13  
    14  import (
    15  	"context"
    16  
    17  	"github.com/go-openapi/strfmt"
    18  	"github.com/stretchr/testify/mock"
    19  	"github.com/weaviate/weaviate/entities/additional"
    20  	"github.com/weaviate/weaviate/entities/search"
    21  )
    22  
    23  type fakeClassConfig map[string]interface{}
    24  
    25  func (cfg fakeClassConfig) Class() map[string]interface{} {
    26  	return cfg
    27  }
    28  
    29  func (cfg fakeClassConfig) ClassByModuleName(moduleName string) map[string]interface{} {
    30  	return cfg
    31  }
    32  
    33  func (cfg fakeClassConfig) Property(string) map[string]interface{} {
    34  	return nil
    35  }
    36  
    37  func (f fakeClassConfig) Tenant() string {
    38  	return ""
    39  }
    40  
    41  func (f fakeClassConfig) TargetVector() string {
    42  	return ""
    43  }
    44  
    45  type fakeObjectsRepo struct {
    46  	mock.Mock
    47  }
    48  
    49  func (r *fakeObjectsRepo) Object(ctx context.Context, class string,
    50  	id strfmt.UUID, props search.SelectProperties,
    51  	addl additional.Properties, tenant string,
    52  ) (*search.Result, error) {
    53  	args := r.Called(ctx, class, id, tenant)
    54  	if args.Get(0) == nil {
    55  		return nil, args.Error(1)
    56  	}
    57  	return args.Get(0).(*search.Result), args.Error(1)
    58  }