testutils

package
v1.7.11 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CanProvide

func CanProvide(provider plugin_v1.Provider,
	id string,
	expectedValue string) func()

CanProvide calls GetValues on the provider and ensures that the provider response for the given id has the expected value and no error

func CanProvideMultiple

func CanProvideMultiple(
	provider plugin_v1.Provider,
	expectedStringValueByID map[string]string,
) func()

CanProvideMultiple calls GetValues on the provider and ensures that the provider's responses for the each id match the expected value and there are no errors. It also duplicates some ids to ensure GetValues can handle multiple instances of the same id

func Reports

func Reports(provider plugin_v1.Provider, id string, expectedErrString string) func()

Reports calls GetValues on the provider and ensures that the provider response for the given id has the expected error and no value

Types

type CanProvideTestCase

type CanProvideTestCase struct {
	Description   string
	ID            string
	ExpectedValue string
}

CanProvideTestCase captures a test case where a provider is expected to return a value and no error

type ReportsTestCase

type ReportsTestCase struct {
	Description       string
	ID                string
	ExpectedErrString string
}

ReportsTestCase captures a test case where a provider is expected to return an error

Jump to

Keyboard shortcuts

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