vppmock

package
v2.5.0-alpha.0...-0e2148d Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HandleReplies

type HandleReplies struct {
	Name     string
	Ping     bool
	Message  govppapi.Message
	Messages []govppapi.Message
}

HandleReplies represents spec for MockReplyHandler.

type TestCtx

type TestCtx struct {
	//*GomegaWithT
	Context   context.Context
	MockVpp   *mock.VppAdapter
	MockStats *mock.StatsAdapter

	MockChannel   *mockedChannel
	MockVPPClient *mockVPPClient
	// contains filtered or unexported fields
}

TestCtx is a helper for unit testing. It wraps VppAdapter which is used instead of real VPP.

func SetupTestCtx

func SetupTestCtx(t *testing.T) *TestCtx

SetupTestCtx sets up all fields of TestCtx structure at the begining of test

func (*TestCtx) MockReplies

func (ctx *TestCtx) MockReplies(dataList []*HandleReplies)

MockReplies sets up reply handler for give HandleReplies.

func (*TestCtx) TeardownTestCtx

func (ctx *TestCtx) TeardownTestCtx()

TeardownTestCtx politely close all used resources

Jump to

Keyboard shortcuts

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