github.com/weaviate/weaviate@v1.24.6/modules/ref2vec-centroid/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 modcentroid
    13  
    14  import (
    15  	"testing"
    16  
    17  	"github.com/weaviate/weaviate/entities/moduletools"
    18  )
    19  
    20  type fakeClassConfig map[string]interface{}
    21  
    22  func (cfg fakeClassConfig) Class() map[string]interface{} {
    23  	return cfg
    24  }
    25  
    26  func (cfg fakeClassConfig) ClassByModuleName(moduleName string) map[string]interface{} {
    27  	return cfg
    28  }
    29  
    30  func (cfg fakeClassConfig) Property(string) map[string]interface{} {
    31  	return nil
    32  }
    33  
    34  func (f fakeClassConfig) Tenant() string {
    35  	return ""
    36  }
    37  
    38  func (f fakeClassConfig) TargetVector() string {
    39  	return ""
    40  }
    41  
    42  func newFakeStorageProvider(t *testing.T) *fakeStorageProvider {
    43  	dirName := t.TempDir()
    44  	return &fakeStorageProvider{dirName}
    45  }
    46  
    47  type fakeStorageProvider struct {
    48  	dataPath string
    49  }
    50  
    51  func (sp fakeStorageProvider) Storage(name string) (moduletools.Storage, error) {
    52  	return nil, nil
    53  }
    54  
    55  func (sp fakeStorageProvider) DataPath() string {
    56  	return sp.dataPath
    57  }