venom: github.com/ovh/venom/lib Index | Files

package venom

import "github.com/ovh/venom/lib"

Index

Package Files

lib.go

Variables

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,
        }
    },
}

type Logger Uses

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

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

func (*Logger) Debugf Uses

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

Debugf calls testing.T.Logf

func (*Logger) Errorf Uses

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

Errorf calls testing.T.Logf

func (*Logger) Fatalf Uses

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

Fatalf calls testing.T.Logf

func (*Logger) Infof Uses

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

Infof calls testing.T.Logf

func (*Logger) Printf Uses

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

Printf calls testing.T.Logf

func (*Logger) Warnf Uses

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

Warnf calls testing.T.Logf

func (*Logger) Warningf Uses

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

Warningf calls testing.T.Logf

func (*Logger) WithField Uses

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

WithField calls testing.T.Logf

type P Uses

type P map[string]interface{}

P is a map of test parameters

func NewExec Uses

func NewExec(script string) P

NewExec returns a venom.P properly initialized for exec Executor

func (P) WithHeaders Uses

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

type R Uses

type R map[string]interface{}

R is a map of Results

type T Uses

type T struct {
    *testing.T

    Name string
    // contains filtered or unexported fields
}

T is a superset of testing.T

func TestCase Uses

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

TestCase instanciates a veom testcase

func (*T) Do Uses

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

Do executes a veom test steps

type V Uses

type V map[string]string

V is a map of Variables

Package venom imports 17 packages (graph). Updated 2019-12-13. Refresh now. Tools for package owners.