utils

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckLine

func CheckLine(t *testing.T, expec, want string, line int)

CheckLine executes assertions to validate the content of two JSON files

func Contains

func Contains(list []string, searchTerm string) bool

Contains returns if a string list contains an especific term

func FileCheck

func FileCheck(t *testing.T, actualPayloadName, expectPayloadName, location string)

FileCheck executes assertions to validate file content length

func GetKICSBinaryPath

func GetKICSBinaryPath(path string) []string

GetKICSBinaryPath gets the kics binary complete path

func HTMLValidation

func HTMLValidation(t *testing.T, file string)

HTMLValidation executes many asserts to validate the HTML Report

func JSONSchemaValidation

func JSONSchemaValidation(t *testing.T, file, schema string)

JSONSchemaValidation execute a schema validation of JSON reports

func PrepareExpected

func PrepareExpected(path, folder string) ([]string, error)

PrepareExpected prepares the files for validation tests

func ReadFixture

func ReadFixture(testName, folder string) (string, error)

ReadFixture reads a file based on a provided path and filename

Types

type CmdOutput

type CmdOutput struct {
	Output []string
	Status int
}

CmdOutput stores the structure of kics output

func RunCommand

func RunCommand(args []string) (*CmdOutput, error)

RunCommand executes the kics in a terminal

Jump to

Keyboard shortcuts

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