testhelper

package
v0.0.62 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2025 License: Apache-2.0 Imports: 22 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 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 DiffUpdates added in v0.0.56

func DiffUpdates(a, b []*types.Update) string

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

func GetLeafListTvProto added in v0.0.40

func GetLeafListTvProto(tvs []*sdcpb.TypedValue) *sdcpb.TypedValue

func GetSchemaClientBound added in v0.0.44

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

GetSchemaClientBound creates a SchemaClientBound mock that responds to certain GetSchema requests

func GetStringTvProto

func GetStringTvProto(s string) *sdcpb.TypedValue

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(i uint64) *sdcpb.TypedValue

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 LoadYgotStructIntoTreeRoot added in v0.0.58

func LoadYgotStructIntoTreeRoot(ctx context.Context, gs ygot.GoStruct, root RootTreeImport, owner string, prio int32, flags *types.UpdateInsertFlags) error

func PathMapIndex

func PathMapIndex(elems []string) string

PathMapIndex calculates a common map index for string slice based paths

func UpdateSliceToStringSlice added in v0.0.56

func UpdateSliceToStringSlice(s []*types.Update) []string

UpdateSliceToStringSlice converts a []*Update to []string

Types

type RootTreeImport added in v0.0.58

type RootTreeImport interface {
	ImportConfig(ctx context.Context, basePath types.PathSlice, importer importer.ImportConfigAdapter, intentName string, intentPrio int32, flags *types.UpdateInsertFlags) error
}

Jump to

Keyboard shortcuts

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