tests

package
v6.2.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2018 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const ApprovedSuffix = ".approved.json"
View Source
const ReceivedSuffix = ".received.json"

Variables

This section is empty.

Functions

func ApproveJson

func ApproveJson(received map[string]interface{}, name string, ignored map[string]string) error

func Compare

func Compare(path string, ignored map[string]string) (map[string]interface{}, []byte, gojsondiff.Diff, error)

func LoadData

func LoadData(file string, processorName string) (map[string]interface{}, error)

func LoadDataAsBytes

func LoadDataAsBytes(fileName string) ([]byte, error)

func LoadInvalidData

func LoadInvalidData(processorName string) (map[string]interface{}, error)

func LoadValidData

func LoadValidData(processorName string) (map[string]interface{}, error)

func LoadValidDataAsBytes

func LoadValidDataAsBytes(processorName string) ([]byte, error)

func StrConcat

func StrConcat(pre string, post string, delimiter string) string

func TestDataAgainstProcessor

func TestDataAgainstProcessor(t *testing.T, p processor.Processor, testData []SchemaTestData)

func TestDocumentedFieldsInEvent

func TestDocumentedFieldsInEvent(t *testing.T, fieldPaths []string, fn processor.NewProcessor, exceptions *set.Set)

func TestEventAttrsDocumentedInFields

func TestEventAttrsDocumentedInFields(t *testing.T, fieldPaths []string, fn processor.NewProcessor)

func TestJsonSchemaKeywordLimitation

func TestJsonSchemaKeywordLimitation(t *testing.T, fieldPaths []string, schema string, exceptions *set.Set)

func TestPayloadAttributesInSchema

func TestPayloadAttributesInSchema(t *testing.T, name string, undocumentedAttrs *set.Set, schema string)

func TestProcessRequests

func TestProcessRequests(t *testing.T, p processor.Processor, requestInfo []RequestInfo, ignored map[string]string)

Types

type Mapping

type Mapping struct {
	// contains filtered or unexported fields
}

type RequestInfo

type RequestInfo struct {
	Name string
	Path string
}

type Schema

type Schema struct {
	Title                string
	Properties           map[string]*Schema
	AdditionalProperties map[string]interface{}
	PatternProperties    map[string]interface{}
	Items                *Schema
	MaxLength            int
}

type SchemaTestData

type SchemaTestData struct {
	File  string
	Error string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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