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

testhelper

package
v0.0.44 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// location of the test schema from the projects root
	SDCIO_SCHEMA_LOCATION = "tests/schema"
)

Functions

func CacheUpdateSliceToStringSlice

func CacheUpdateSliceToStringSlice(s []*cache.Update) []string

CacheUpdateSliceToStringSlice converts a []*cache.Update to []string

func ConfigureCacheClientMock

func ConfigureCacheClientMock(t *testing.T, cacheClient *mockcacheclient.MockClient, updatesIntended []*cache.Update, updatesRunning []*cache.Update, expectedModify []*cache.Update, expectedDeletes [][]string)

func DiffCacheUpdates

func DiffCacheUpdates(a, b []*cache.Update) string

diffCacheUpdates takes two []*cache.Update and compares the diff

func DiffDoubleStringPathSlice

func DiffDoubleStringPathSlice(s1, s2 [][]string) string

func DiffStringSlice

func DiffStringSlice(s1, s2 []string, forceNoSideEffect bool) string

DiffStringSlice compares two string slices returning the

func GetLeafListTvProto added in v0.0.40

func GetLeafListTvProto(t *testing.T, tvs []*sdcpb.TypedValue) []byte

func GetSchemaClientBound added in v0.0.44

func GetSchemaClientBound(t *testing.T) (*mockschemaclientbound.MockSchemaClientBound, error)

GetSchemaClientBound creates a SchemaClientBound mock that responds to certain GetSchema requests

func GetStringTvProto

func GetStringTvProto(t *testing.T, s string) []byte

GetStringTvProto takes a string and returns the sdcpb.TypedValue for it in proto encoding as []byte

func GetTestFilename

func GetTestFilename() string

func GetUIntTvProto

func GetUIntTvProto(t *testing.T, i uint64) []byte

GetStringTvProto takes a string and returns the sdcpb.TypedValue for it in proto encoding as []byte

func InitSDCIOSchema

func InitSDCIOSchema() (dataschema.Client, *dConfig.SchemaConfig, error)

func PathMapIndex

func PathMapIndex(elems []string) string

PathMapIndex calculates a common map index for string slice based paths

Types

type SchemaClient

type SchemaClient struct {
	schemaStore.Store
}

func (*SchemaClient) CreateSchema

creates a schema

func (*SchemaClient) DeleteSchema

delete a schema

func (*SchemaClient) ExpandPath

ExpandPath returns a list of sub paths given a single path

func (*SchemaClient) GetSchema

returns the schema of an item identified by a gNMI-like path

func (*SchemaClient) GetSchemaDetails

returns schema name, vendor, version, and files path(s)

func (*SchemaClient) GetSchemaElements

func (s *SchemaClient) GetSchemaElements(ctx context.Context, req *sdcpb.GetSchemaRequest, opts ...grpc.CallOption) (chan *sdcpb.SchemaElem, error)

func (*SchemaClient) ListSchema

lists known schemas with name, vendor, version and status

func (*SchemaClient) ReloadSchema

trigger schema reload

func (*SchemaClient) ToPath

ToPath converts a list of items into a schema.proto.Path

func (*SchemaClient) UploadSchema

Jump to

Keyboard shortcuts

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