testdb

package
v2.1.0-alpha9 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package testdb provides functionality for working with test databases.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddHTTPBodyToMap

func AddHTTPBodyToMap(body string, m map[string][]string) error

func ContainsMatchingURL

func ContainsMatchingURL(urlMethods []string, urlStr string, requestURL string, requestMethod models.Method) (bool, error)

func Decode

func Decode(yamlTestcase *yaml.NetworkTrafficDoc, logger *zap.Logger) (*models.TestCase, error)

func EncodeTestcase

func EncodeTestcase(tc models.TestCase, logger *zap.Logger) (*yaml.NetworkTrafficDoc, error)

func FindNoisyFields

func FindNoisyFields(m map[string][]string, comparator func(string, []string) bool) []string

func Flatten

func Flatten(j interface{}) map[string][]string

Flatten takes a map and returns a new one where nested maps are replaced by dot-delimited keys. examples of valid jsons - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse#examples

func FlattenHTTPResponse

func FlattenHTTPResponse(h http.Header, body string) (map[string][]string, error)

func HasBannedHeaders

func HasBannedHeaders(object map[string]string, bannedHeaders map[string]string) (bool, error)

Types

type TestYaml

type TestYaml struct {
	TcsPath string
	// contains filtered or unexported fields
}

func New

func New(logger *zap.Logger, tcsPath string) *TestYaml

func (*TestYaml) GetAllTestSetIDs

func (ts *TestYaml) GetAllTestSetIDs(ctx context.Context) ([]string, error)

func (*TestYaml) GetTestCases

func (ts *TestYaml) GetTestCases(ctx context.Context, testSetID string) ([]*models.TestCase, error)

func (*TestYaml) InsertTestCase

func (ts *TestYaml) InsertTestCase(ctx context.Context, tc *models.TestCase, testSetID string) error

func (*TestYaml) UpdateTestCase

func (ts *TestYaml) UpdateTestCase(ctx context.Context, tc *models.TestCase, testSetID string) error

Jump to

Keyboard shortcuts

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