Help us shape the future of Go! Take the 2026 Go Developer Survey

mocks

package
v1.47.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 26, 2026 License: BSD-2-Clause Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MockAnnoSearchStrainID = "DBS0235559"
)

Shared fixture literals, named because golangci-lint goconst requires repeated string literals to be declared as constants.

View Source
const (
	MockStockSearchID = "DBS0236126"
)

MockStockSearchID is the stock_id carried by the search result fixtures below.

Variables

View Source
var (
	MockSysNameAnno   = MockTagAnno(annotatedEntryID, registry.SysnameTag)
	MockGenModAnno    = MockTagAnno("exogenous mutation", registry.MuttypeTag)
	MockMutMethodAnno = MockTagAnno("Random Insertion", registry.MutmethodTag)
)
View Source
var ContentTimestamp = timestamppb.New(time.Date(2020, time.January, 1, 1, 0, 0, 0, time.UTC))
View Source
var MockContentAttributes = &content.ContentAttributes{
	Name:      "test-page",
	Slug:      "news-test-page",
	CreatedBy: createdByEmail,
	UpdatedBy: updatedByEmail,
	CreatedAt: ContentTimestamp,
	UpdatedAt: ContentTimestamp,
	Content:   "test content body",
	Namespace: "news",
}
View Source
var MockGenotypeAnno = MockTagAnno(
	"axeA1,axeB1,axeC1,sadA-[sadA-KO],[pSadA-GFP],bsR,neoR",
	registry.GenoTag,
)
View Source
var MockInStockAnno = MockTagAnno(annotatedEntryID, registry.SysnameTag)
View Source
var MockOrderAttributes = &order.OrderAttributes{
	CreatedAt:        timestamppb.Now(),
	UpdatedAt:        timestamppb.Now(),
	Courier:          "USPS",
	CourierAccount:   "123456",
	Comments:         "first order",
	Payment:          "credit",
	PurchaseOrderNum: "987654",
	Status:           0,
	Consumer:         "art@vandelayindustries.com",
	Payer:            "george@costanza.com",
	Purchaser:        "thatsgold@jerry.org",
	Items:            []string{"DBS123456"},
}
View Source
var MockPlasmidAttributes = &stock.PlasmidAttributes{
	CreatedAt:       StockTimestamp,
	UpdatedAt:       StockTimestamp,
	CreatedBy:       createdByEmail,
	UpdatedBy:       createdByEmail,
	Summary:         "test summary",
	EditableSummary: "editable test summary",
	Genes:           []string{"DDB_G0285425"},
	Dbxrefs:         []string{dbxrefTest},
	Publications:    []string{"99999"},
	ImageMap:        "https://eric.dictybase.dev/test.jpg",
	Sequence:        "ABCDEF",
	Name:            plasmidName,
}
View Source
var MockStrainAttributes = &stock.StrainAttributes{
	CreatedAt:       StockTimestamp,
	UpdatedAt:       StockTimestamp,
	CreatedBy:       createdByEmail,
	UpdatedBy:       createdByEmail,
	Summary:         "test summary",
	EditableSummary: "editable test summary",
	Depositor:       "kenny@bania.com",
	Genes:           []string{"DDB_G0285425"},
	Dbxrefs:         []string{dbxrefTest},
	Publications:    []string{"99999"},
	Label:           "test99",
	Species:         "human",
	Plasmid:         plasmidName,
	Names:           []string{"fusilli"},
}
View Source
var MockUpdatePlasmidAttributes = &stock.PlasmidAttributes{
	CreatedAt:       StockTimestamp,
	UpdatedAt:       StockTimestamp,
	CreatedBy:       createdByEmail,
	UpdatedBy:       updatedByEmail,
	Summary:         "updated summary",
	EditableSummary: "editable updated summary",
	Depositor:       "puddy@nyrangers.com",
	Genes:           []string{"sadA"},
	Dbxrefs:         []string{dbxrefTest},
	Publications:    []string{"99999"},
	ImageMap:        "https://eric.dictybase.dev/test.jpg",
	Sequence:        "ABCDEF",
	Name:            plasmidName,
}
View Source
var MockUpdateStrainAttributes = &stock.StrainAttributes{
	CreatedAt:       StockTimestamp,
	UpdatedAt:       StockTimestamp,
	CreatedBy:       createdByEmail,
	UpdatedBy:       updatedByEmail,
	Summary:         "updated summary",
	EditableSummary: "editable updated summary",
	Depositor:       "puddy@nyrangers.com",
	Genes:           []string{"sadA"},
	Dbxrefs:         []string{dbxrefTest},
	Publications:    []string{"99999"},
	Label:           "test99",
	Species:         "human",
	Plasmid:         plasmidName,
	Names:           []string{"fusilli"},
}
View Source
var (
	StockTimestamp = timestamppb.New(t)
)

Functions

func MockAnnotationSearchResultCollection

func MockAnnotationSearchResultCollection() *annotation.AnnotationSearchResultCollection

func MockAnnotationSuggestionCollection

func MockAnnotationSuggestionCollection() *annotation.AnnotationSuggestionCollection

func MockBacterialAnnoEntry

func MockBacterialAnnoEntry(id string) *annotation.TaggedAnnotationCollection_Data

MockBacterialAnnoEntry creates one "bacterial food source" annotation entry.

func MockBacterialStrainListAnno

func MockBacterialStrainListAnno() *annotation.TaggedAnnotationCollection

MockBacterialStrainListAnno returns two distinct IDs plus one duplicate to exercise deduplication in the bacterial pipeline. After deduplication: [DBS000001, DBS000002]

func MockCharacteristicsAnno

func MockCharacteristicsAnno() *annotation.TaggedAnnotationCollection

func MockContentCollection

func MockContentCollection() *content.ContentCollection

func MockPhenoCollectionAnno

func MockPhenoCollectionAnno(
	tag, id string,
) *annotation.TaggedAnnotationCollection_Data

MockPhenoCollectionAnno is used to test the ListStrainsWithPhenotype method.

func MockPhenotypeListAnno

func MockPhenotypeListAnno() *annotation.TaggedAnnotationCollection

func MockPlasmidCollection

func MockPlasmidCollection() *stock.PlasmidCollection

func MockPlasmidInputWithParams

func MockPlasmidInputWithParams(depositor string) *stock.PlasmidAttributes

func MockSearchStrainList

func MockSearchStrainList() *stock.StrainList

func MockStockSearchResultCollection

func MockStockSearchResultCollection() *stock.StockSearchResultCollection

func MockStockSuggestionCollection

func MockStockSuggestionCollection() *stock.StockSuggestionCollection

func MockStrain

func MockStrain() *stock.Strain

func MockStrainCollection

func MockStrainCollection() *stock.StrainCollection

func MockStrainInputWithParams

func MockStrainInputWithParams(
	depositor, parent string,
) *stock.StrainAttributes

func MockStrainList

func MockStrainList() *stock.StrainList

func MockTagAnno

func MockTagAnno(value, tag string) *annotation.TaggedAnnotation

func MockTagGroupAnno

func MockTagGroupAnno(
	onto, tag, value string,
) *annotation.TaggedAnnotationGroup_Data

func MockTagList

func MockTagList(
	onto, tag, value string,
) *annotation.TaggedAnnotationCollection_Data

func MockedAnnotationClient

func MockedAnnotationClient() *clients.TaggedAnnotationServiceClient

func MockedAuthClient

func MockedAuthClient() authentication.LogtoClient

func MockedCharacteristicsClient

func MockedCharacteristicsClient() *clients.TaggedAnnotationServiceClient

func MockedContentClient

func MockedContentClient() *clients.ContentServiceClient

func MockedGenotypeClient

func MockedGenotypeClient() *clients.TaggedAnnotationServiceClient

func MockedIdentityClient

func MockedIdentityClient() *clients.IdentityServiceClient

func MockedInStockClient

func MockedInStockClient() *clients.TaggedAnnotationServiceClient

func MockedInStockErrorClient

func MockedInStockErrorClient() *clients.TaggedAnnotationServiceClient

MockedInStockErrorClient fails the inventory lookup with an internal error.

func MockedMutMethodClient

func MockedMutMethodClient() *clients.TaggedAnnotationServiceClient

func MockedNotInStockClient

func MockedNotInStockClient() *clients.TaggedAnnotationServiceClient

MockedNotInStockClient answers the inventory lookup with not-found.

func MockedOrderClient

func MockedOrderClient() *clients.OrderServiceClient

func MockedPermissionClient

func MockedPermissionClient() *clients.PermissionServiceClient

func MockedPhenotypeClient

func MockedPhenotypeClient() *clients.TaggedAnnotationServiceClient

func MockedRoleClient

func MockedRoleClient() *clients.RoleServiceClient

func MockedStockClient

func MockedStockClient() *clients.StockServiceClient

func MockedSysNameAnnoClient

func MockedSysNameAnnoClient() *clients.TaggedAnnotationServiceClient

func MockedUserClient

func MockedUserClient() *clients.UserServiceClient

func TestLogger

func TestLogger() *logrus.Entry

Types

type MockRegistry

type MockRegistry struct {
	ConnMap *hashmap.Map
}

func (*MockRegistry) AddAPIConnection

func (mr *MockRegistry) AddAPIConnection(key string, conn *grpc.ClientConn)

func (*MockRegistry) AddAPIEndpoint

func (mr *MockRegistry) AddAPIEndpoint(key, endpoint string)

func (*MockRegistry) AddAuthClient

func (mr *MockRegistry) AddAuthClient(
	key string, auth authentication.LogtoClient,
)

func (*MockRegistry) AddRecord

func (mr *MockRegistry) AddRecord(key, value string)

func (*MockRegistry) AddRepository

func (mr *MockRegistry) AddRepository(key string, st repository.Repository)

func (*MockRegistry) AddS3Client

func (mr *MockRegistry) AddS3Client(key string, s3c *minio.Client)

func (*MockRegistry) GetAPIConnection

func (mr *MockRegistry) GetAPIConnection(key string) (conn *grpc.ClientConn)

GetAPIClient looks up a client in the hashmap

func (MockRegistry) GetAPIEndpoint

func (mr MockRegistry) GetAPIEndpoint(key string) string

func (*MockRegistry) GetAnnotationClient

func (mr *MockRegistry) GetAnnotationClient(
	key string,
) annotation.TaggedAnnotationServiceClient

func (*MockRegistry) GetAuthClient

func (mr *MockRegistry) GetAuthClient(key string) authentication.LogtoClient

func (*MockRegistry) GetContentClient

func (mr *MockRegistry) GetContentClient(
	key string,
) content.ContentServiceClient

func (*MockRegistry) GetFeatAnnotationClient

func (mr *MockRegistry) GetFeatAnnotationClient(
	name string,
) feature.FeatureAnnotationServiceClient

GetFeatAnnotationClient provides a mock function with given fields: name

func (*MockRegistry) GetIdentityClient

func (mr *MockRegistry) GetIdentityClient(
	key string,
) identity.IdentityServiceClient

func (*MockRegistry) GetOrderClient

func (mr *MockRegistry) GetOrderClient(key string) order.OrderServiceClient

func (*MockRegistry) GetPermissionClient

func (mr *MockRegistry) GetPermissionClient(
	key string,
) user.PermissionServiceClient

func (*MockRegistry) GetRecord

func (mr *MockRegistry) GetRecord(key string) string

func (MockRegistry) GetRedisRepository

func (mr MockRegistry) GetRedisRepository(key string) repository.Repository

func (*MockRegistry) GetRoleClient

func (mr *MockRegistry) GetRoleClient(key string) user.RoleServiceClient

func (*MockRegistry) GetS3Client

func (mr *MockRegistry) GetS3Client(key string) *minio.Client

func (*MockRegistry) GetStockClient

func (mr *MockRegistry) GetStockClient(key string) stock.StockServiceClient

func (*MockRegistry) GetUserClient

func (mr *MockRegistry) GetUserClient(key string) user.UserServiceClient

func (*MockRegistry) ServiceMap

func (mr *MockRegistry) ServiceMap() map[string]string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL