test

package
v0.0.0-...-a7eb91c Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2017 License: MPL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StateCancelled = "cancelled"
	StateHalted    = "halted"
)
View Source
const (
	// CharSetAlphaNum is the alphanumeric character set for use with
	// RandStringFromCharSet
	CharSetAlphaNum = "abcdefghijklmnopqrstuvwxyz012346789"

	// CharSetAlpha is the alphabetical character set for use with
	// RandStringFromCharSet
	CharSetAlpha = "abcdefghijklmnopqrstuvwxyz"
)
View Source
const TestEnvVar = "RIVIERA_TEST"

Variables

This section is empty.

Functions

func RandInt

func RandInt() int

RandInt generates a random integer

func RandPrefixString

func RandPrefixString(prefix string, strlen int) string

RandPrefixString generates a random alphanumeric string of the length specified with the given prefix

func RandString

func RandString(strlen int) string

RandString generates a random alphanumeric string of the length specified

func RandStringFromCharSet

func RandStringFromCharSet(strlen int, charSet string) string

RandStringFromCharSet generates a random string by selecting characters from the charset provided

func Test

func Test(t *testing.T, c TestCase)

Types

type AssertFunc

type AssertFunc func(AzureStateBag) error

type AzureStateBag

type AzureStateBag interface {
	Get(string) interface{}
	GetOk(string) (interface{}, bool)
	Put(string, interface{})
	Remove(string)

	Client() *azure.Client

	AppendError(error)
	ErrorsOrNil() error
}

type Step

type Step interface {
	Run(AzureStateBag) StepAction

	Cleanup(AzureStateBag)
}

type StepAction

type StepAction uint
const (
	Continue StepAction = iota
	Halt
)

type StepAssert

type StepAssert struct {
	StateBagKey string
	Assertions  seq.Map
}

func (*StepAssert) Cleanup

func (s *StepAssert) Cleanup(state AzureStateBag)

func (*StepAssert) Run

func (s *StepAssert) Run(state AzureStateBag) StepAction

type StepCreateResourceGroup

type StepCreateResourceGroup struct {
	Name     string
	Location string
	Tags     map[string]*string
}

func (*StepCreateResourceGroup) Cleanup

func (s *StepCreateResourceGroup) Cleanup(state AzureStateBag)

func (*StepCreateResourceGroup) Run

type StepRegisterResourceProvider

type StepRegisterResourceProvider struct {
	Namespace string
}

func (*StepRegisterResourceProvider) Cleanup

func (s *StepRegisterResourceProvider) Cleanup(state AzureStateBag)

func (*StepRegisterResourceProvider) Run

type StepRunCommand

type StepRunCommand struct {
	RunCommand         azure.APICall
	CleanupCommand     azure.APICall
	StateCommandURIKey string
	StateCommand       azure.APICall
	StateBagKey        string
}

func (*StepRunCommand) Cleanup

func (s *StepRunCommand) Cleanup(state AzureStateBag)

func (*StepRunCommand) Run

func (s *StepRunCommand) Run(state AzureStateBag) StepAction

type TestCase

type TestCase struct {
	Steps []Step
	State AzureStateBag
}

Jump to

Keyboard shortcuts

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