testutil

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package testutil contains helper functions for component unit tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigFromMap

func ConfigFromMap(t *testing.T, m map[string]string, k string) string

ConfigFromMap takes a map and a key and returns the value associated with the key. If the key does not exist in that map, the function fails.

func MatchJSONPathInt64Value added in v0.6.1

func MatchJSONPathInt64Value(t *testing.T, yamlConfig string, jsonPath string, expected int64)

MatchJSONPathInt64Value is a helper function for component unit tests. It compares the integer at a JSON path in a YAML config to the expected integer.

func MatchJSONPathStringValue

func MatchJSONPathStringValue(t *testing.T, yamlConfig string, jsonPath string, expected string)

MatchJSONPathStringValue is a helper function for component unit tests. It compares the string at a JSON path in a YAML config to the expected string.

func RenderManifests

func RenderManifests(
	t *testing.T, component components.Component, componentName string, hclConfig string,
) map[string]string

RenderManifests converts a component into YAML manifests.

Types

This section is empty.

Jump to

Keyboard shortcuts

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