Documentation ¶
Index ¶
- Variables
- func CheckCmdOutput(t *testing.T, output []byte, matchWith *regexp.Regexp)
- func CheckErr(t *testing.T, err error)
- func DownloadWebpage(pageUrl string, expectedStatus int, headers map[string]string, ...) ([]byte, error)
- func PrintResults(items []interface{}, pages int, compact bool)
- func RegisterMockHTTPClient()
- func SearchRegex(expr string, target string, fieldName string) (string, error)
- type HTTPClient
- type MockClient
- type TestCase
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func CheckCmdOutput ¶
CheckCmdOutput can be used to match output of a command with a target Regexp.
func DownloadWebpage ¶
func DownloadWebpage( pageUrl string, expectedStatus int, headers map[string]string, params map[string]string, ) ([]byte, error)
DownloadWebpage downloads a webpage and returns content as byte array if successful. An error is returned otherwise.
func PrintResults ¶
PrintResults writes search result to stdout.
func RegisterMockHTTPClient ¶
func RegisterMockHTTPClient()
RegisterMockHTTPClient replaces real http client with a mock client.
Types ¶
type HTTPClient ¶
var Client HTTPClient
type MockClient ¶
MockClient is the mock client.
Click to show internal directories.
Click to hide internal directories.