Documentation ¶
Overview ¶
Package testutils implements test utilities.
Package testutils implements test utilities.
Index ¶
- func AddRemotes(values []resource.Name, remotes ...string) []resource.Name
- func AddSuffixes(values []resource.Name, suffixes ...string) []resource.Name
- func ConcatResourceNames(values ...[]resource.Name) []resource.Name
- func ExtractNames(values ...resource.Name) []string
- func NewResourceNameSet(resourceNames ...resource.Name) map[resource.Name]struct{}
- type FakeConvertedAttributes
- type TrackingDialer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddRemotes ¶
AddRemotes takes a slice of resource.Name objects and for each remote, adds the remote to every object, then returns the entire list.
func AddSuffixes ¶
AddSuffixes takes a slice of resource.Name objects and for each suffix, adds the suffix to every object, then returns the entire list.
func ConcatResourceNames ¶
ConcatResourceNames takes a slice of slices of resource.Name objects and returns a concatenated slice of resource.Name for the purposes of comparison in automated tests.
func ExtractNames ¶
ExtractNames takes a slice of resource.Name objects and returns a slice of name strings for the purposes of comparison in automated tests.
Types ¶
type FakeConvertedAttributes ¶
type FakeConvertedAttributes struct {
Thing string
}
FakeConvertedAttributes is a helper for testing if validation works.
func (*FakeConvertedAttributes) Validate ¶
func (convAttr *FakeConvertedAttributes) Validate(path string) error
Validate validates that the single fake attribute Thing exists properly in the struct, meant to implement the validator interface in component.go.
type TrackingDialer ¶
TrackingDialer tracks dial attempts.
func (*TrackingDialer) DialDirect ¶
func (td *TrackingDialer) DialDirect( ctx context.Context, target string, keyExtra string, onClose func() error, opts ...grpc.DialOption, ) (rpc.ClientConn, bool, error)
DialDirect tracks calls of DialDirect.
func (*TrackingDialer) DialFunc ¶
func (td *TrackingDialer) DialFunc( proto string, target string, keyExtra string, f func() (rpc.ClientConn, func() error, error), ) (rpc.ClientConn, bool, error)
DialFunc tracks calls of DialFunc.
Directories ¶
Path | Synopsis |
---|---|
Package inject provides dependency injected structures for mocking interfaces.
|
Package inject provides dependency injected structures for mocking interfaces. |
Package robottestutils provides helper functions in testing
|
Package robottestutils provides helper functions in testing |