venom

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2018 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var HTTP = struct {
	Get      func(url, path string) P
	Post     func(url, path string, body []byte) P
	PostJSON func(url, path string, body interface{}) P
	Put      func(url, path string, body []byte) P
	PutJSON  func(url, path string, body interface{}) P
	Delete   func(url, path string) P
}{
	Get: func(url, path string) P {
		return P{
			"type":   "http",
			"method": "GET",
			"url":    url,
			"path":   path,
		}
	},
	Post: func(url, path string, body []byte) P {
		return P{
			"type":   "http",
			"method": "POST",
			"url":    url,
			"path":   path,
			"body":   string(body),
		}
	},
	PostJSON: func(url, path string, body interface{}) P {
		b, err := json.Marshal(body)
		if err != nil {
			panic(err)
		}
		return P{
			"type":   "http",
			"method": "POST",
			"url":    url,
			"path":   path,
			"body":   string(b),
		}
	},
	Put: func(url, path string, body []byte) P {
		return P{
			"type":   "http",
			"method": "PUT",
			"url":    url,
			"path":   path,
			"body":   string(body),
		}
	},
	PutJSON: func(url, path string, body interface{}) P {
		b, err := json.Marshal(body)
		if err != nil {
			panic(err)
		}
		return P{
			"type":   "http",
			"method": "PUT",
			"url":    url,
			"path":   path,
			"body":   string(b),
		}
	},
	Delete: func(url, path string) P {
		return P{
			"type":   "http",
			"method": "DELETE",
			"url":    url,
			"path":   path,
		}
	},
}

Functions

This section is empty.

Types

type Logger

type Logger struct {
	// contains filtered or unexported fields
}

Logger is a superset of the testing Logger compliant with logrus Entry

func (*Logger) Debugf

func (l *Logger) Debugf(format string, args ...interface{})

Debugf calls testing.T.Logf

func (*Logger) Errorf

func (l *Logger) Errorf(format string, args ...interface{})

Errorf calls testing.T.Logf

func (*Logger) Fatalf

func (l *Logger) Fatalf(format string, args ...interface{})

Fatalf calls testing.T.Logf

func (*Logger) Infof

func (l *Logger) Infof(format string, args ...interface{})

Infof calls testing.T.Logf

func (*Logger) Printf

func (l *Logger) Printf(format string, args ...interface{})

Printf calls testing.T.Logf

func (*Logger) Warnf

func (l *Logger) Warnf(format string, args ...interface{})

Warnf calls testing.T.Logf

func (*Logger) Warningf

func (l *Logger) Warningf(format string, args ...interface{})

Warningf calls testing.T.Logf

func (*Logger) WithField

func (l *Logger) WithField(key string, value interface{}) venom.Logger

WithField calls testing.T.Logf

type P

type P map[string]interface{}

P is a map of test parameters

func NewExec

func NewExec(script string) P

NewExec returns a venom.P properly initialized for exec Executor

func (P) WithHeaders

func (p P) WithHeaders(headers http.Headers) P

type R

type R map[string]interface{}

R is a map of Results

type T

type T struct {
	*testing.T

	Name string
	// contains filtered or unexported fields
}

T is a superset of testing.T

func TestCase

func TestCase(t *testing.T, name string, variables map[string]string) *T

TestCase instanciates a veom testcase

func (*T) Do

func (t *T) Do(teststepParams P) R

Do executes a veom test steps

type V

type V map[string]string

V is a map of Variables

Jump to

Keyboard shortcuts

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