Documentation ¶
Index ¶
- Variables
- func AssertPythonPackage(python3 string, pkgName, pkgVersion string) error
- func ContainedBy(t assert.TestingT, actual, expected interface{}, msgAndArgs ...interface{}) bool
- func Contains(s []string, e string) bool
- func CreateFile(filePath string, data string) error
- func CreateFolder(folderPath string) error
- func Dump2JSON(data interface{}, path string) error
- func Dump2YAML(data interface{}, path string) error
- func EndsWith(t assert.TestingT, actual, expected interface{}, msgAndArgs ...interface{}) bool
- func EnsureFolderExists(folderPath string) error
- func EnsurePython3Venv(venv string, packages ...string) (python3 string, err error)
- func EqualFold(t assert.TestingT, actual, expected interface{}, msgAndArgs ...interface{}) bool
- func EqualLength(t assert.TestingT, actual, expected interface{}, msgAndArgs ...interface{}) bool
- func EqualValues(t assert.TestingT, actual, expected interface{}, msgAndArgs ...interface{}) bool
- func ExecCommand(cmdName string, args ...string) error
- func ExecCommandInDir(cmd *exec.Cmd, dir string) error
- func ExecPython3Command(cmdName string, args ...string) error
- func FormatResponse(raw interface{}) interface{}
- func GetOutputNameWithoutExtension(path string) string
- func GetRandomNumber(min, max int) int
- func GreaterOrEqualsLength(t assert.TestingT, actual, expected interface{}, msgAndArgs ...interface{}) bool
- func GreaterThanLength(t assert.TestingT, actual, expected interface{}, msgAndArgs ...interface{}) bool
- func InstallPythonPackage(python3 string, pkg string) (err error)
- func Interface2Float64(i interface{}) (float64, error)
- func InterfaceType(raw interface{}) string
- func IsFilePathExists(path string) bool
- func IsFolderPathExists(path string) bool
- func IsPathExists(path string) bool
- func LessOrEqualsLength(t assert.TestingT, actual, expected interface{}, msgAndArgs ...interface{}) bool
- func LessThanLength(t assert.TestingT, actual, expected interface{}, msgAndArgs ...interface{}) bool
- func LoadFile(path string, structObj interface{}) (err error)
- func MD5(str string) string
- func NotEqual(t assert.TestingT, actual, expected interface{}, msgAndArgs ...interface{}) bool
- func ReadFile(path string) ([]byte, error)
- func RegexMatch(t assert.TestingT, actual, expected interface{}, msgAndArgs ...interface{}) bool
- func StartsWith(t assert.TestingT, actual, expected interface{}, msgAndArgs ...interface{}) bool
- func StringEqual(t assert.TestingT, actual, expected interface{}, msgAndArgs ...interface{}) bool
- func TypeNormalization(raw interface{}) interface{}
Constants ¶
This section is empty.
Variables ¶
View Source
var Assertions = map[string]func(t assert.TestingT, actual interface{}, expected interface{}, msgAndArgs ...interface{}) bool{ "eq": EqualValues, "equals": EqualValues, "equal": EqualValues, "lt": assert.Less, "less_than": assert.Less, "le": assert.LessOrEqual, "less_or_equals": assert.LessOrEqual, "gt": assert.Greater, "greater_than": assert.Greater, "ge": assert.GreaterOrEqual, "greater_or_equals": assert.GreaterOrEqual, "ne": NotEqual, "not_equal": NotEqual, "contains": assert.Contains, "type_match": assert.IsType, "startswith": StartsWith, "endswith": EndsWith, "len_eq": EqualLength, "length_equals": EqualLength, "length_equal": EqualLength, "len_lt": LessThanLength, "count_lt": LessThanLength, "length_less_than": LessThanLength, "len_le": LessOrEqualsLength, "count_le": LessOrEqualsLength, "length_less_or_equals": LessOrEqualsLength, "len_gt": GreaterThanLength, "count_gt": GreaterThanLength, "length_greater_than": GreaterThanLength, "len_ge": GreaterOrEqualsLength, "count_ge": GreaterOrEqualsLength, "length_greater_or_equals": GreaterOrEqualsLength, "contained_by": ContainedBy, "str_eq": StringEqual, "string_equals": StringEqual, "equal_fold": EqualFold, "regex_match": RegexMatch, }
View Source
var ErrUnsupportedFileExt = fmt.Errorf("unsupported file extension")
Functions ¶
func AssertPythonPackage ¶
func ContainedBy ¶
ContainedBy assert whether actual element contains expected element
func CreateFile ¶
func CreateFolder ¶
func EnsureFolderExists ¶
func EnsurePython3Venv ¶
EnsurePython3Venv ensures python3 venv with specified packages venv should be directory path of target venv
func EqualLength ¶
func EqualValues ¶
func ExecCommand ¶
func ExecPython3Command ¶
func FormatResponse ¶
func FormatResponse(raw interface{}) interface{}
func GetRandomNumber ¶
func GreaterOrEqualsLength ¶
func GreaterThanLength ¶
func InstallPythonPackage ¶
func Interface2Float64 ¶
func InterfaceType ¶
func InterfaceType(raw interface{}) string
func IsFilePathExists ¶
IsFilePathExists returns true if path exists and path is file
func IsFolderPathExists ¶
IsFolderPathExists returns true if path exists and path is folder
func IsPathExists ¶
IsPathExists returns true if path exists, whether path is file or dir
func LessOrEqualsLength ¶
func LessThanLength ¶
func RegexMatch ¶
func StartsWith ¶
StartsWith check if string starts with substring
func StringEqual ¶
func TypeNormalization ¶
func TypeNormalization(raw interface{}) interface{}
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.