testutils

package
v2.1.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2019 License: Apache-2.0, BSD-3-Clause, MIT Imports: 14 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertClauseSerialize

func AssertClauseSerialize(t *testing.T, dialect jet.Dialect, clause jet.Serializer, query string, args ...interface{})

AssertClauseSerialize checks if clause serialize produces expected query and args

func AssertClauseSerializeErr

func AssertClauseSerializeErr(t *testing.T, dialect jet.Dialect, clause jet.Serializer, errString string)

AssertClauseSerializeErr check if clause serialize panics with errString

func AssertDebugStatementSql

func AssertDebugStatementSql(t *testing.T, query jet.Statement, expectedQuery string, expectedArgs ...interface{})

AssertDebugStatementSql check if statement Sql() is the same as expectedQuery

func AssertExec

func AssertExec(t *testing.T, stmt jet.Statement, db qrm.DB, rowsAffected ...int64)

AssertExec assert statement execution for successful execution and number of rows affected

func AssertExecErr

func AssertExecErr(t *testing.T, stmt jet.Statement, db qrm.DB, errorStr string)

AssertExecErr assert statement execution for failed execution with error string errorStr

func AssertFileContent

func AssertFileContent(t *testing.T, filePath string, contentBegin string, expectedContent string)

AssertFileContent check if file content at filePath contains expectedContent text.

func AssertFileNamesEqual

func AssertFileNamesEqual(t *testing.T, fileInfos []os.FileInfo, fileNames ...string)

AssertFileNamesEqual check if all filesInfos are contained in fileNames

func AssertJSON

func AssertJSON(t *testing.T, data interface{}, expectedJSON string)

AssertJSON check if data json output is the same as expectedJSON

func AssertJSONFile

func AssertJSONFile(t *testing.T, data interface{}, testRelativePath string)

AssertJSONFile check if data json representation is the same as json at testRelativePath

func AssertProjectionSerialize

func AssertProjectionSerialize(t *testing.T, dialect jet.Dialect, projection jet.Projection, query string, args ...interface{})

AssertProjectionSerialize check if projection serialize produces expected query and args

func AssertQueryPanicErr

func AssertQueryPanicErr(t *testing.T, stmt jet.Statement, db qrm.DB, dest interface{}, errString string)

AssertQueryPanicErr check if statement Query execution panics with error errString

func AssertStatementSql

func AssertStatementSql(t *testing.T, query jet.Statement, expectedQuery string, expectedArgs ...interface{})

AssertStatementSql check if statement Sql() is the same as expectedQuery and expectedArgs

func AssertStatementSqlErr

func AssertStatementSqlErr(t *testing.T, stmt jet.Statement, errorStr string)

AssertStatementSqlErr checks if statement Sql() panics with errorStr

func Date

func Date(t string) *time.Time

Date creates time from t string

func PrintJson

func PrintJson(v interface{})

PrintJson print v as json

func SaveJSONFile

func SaveJSONFile(v interface{}, testRelativePath string)

SaveJSONFile saves v as json at testRelativePath

func TimeWithTimeZone

func TimeWithTimeZone(t string) *time.Time

TimeWithTimeZone creates time from t

func TimeWithoutTimeZone

func TimeWithoutTimeZone(t string) *time.Time

TimeWithoutTimeZone creates time from t

func TimestampWithTimeZone

func TimestampWithTimeZone(t string, precision int) *time.Time

TimestampWithTimeZone creates time from t

func TimestampWithoutTimeZone

func TimestampWithoutTimeZone(t string, precision int) *time.Time

TimestampWithoutTimeZone creates time from t

Types

This section is empty.

Jump to

Keyboard shortcuts

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