assert

package
v0.0.0-...-60f4931 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FileExistence

func FileExistence(t *testing.T, service, path string, shouldExist bool)

Types

type Assertion

type Assertion func() error

func HTTPGetShouldContain

func HTTPGetShouldContain(endpoint, exp string) Assertion

func HTTPGetShouldEqual

func HTTPGetShouldEqual(endpoint, exp string) Assertion

func HTTPGetShouldNotContain

func HTTPGetShouldNotContain(endpoint, str string) Assertion

type CodeChangeTest

type CodeChangeTest struct {
	Name string

	// The path to the file that we're going to change.
	CodePath string

	// The modification that should be made to CodePath.
	FileChange file.Modifier

	// The expected response before the code is changed.
	InitialResponseCheck Assertion

	// The expected response after the code is changed.
	ChangedResponseCheck Assertion
}

CodeChangeTest tests that Kelda properly syncs files by modifying a file, and checking the HTTP response.

func (CodeChangeTest) GetName

func (test CodeChangeTest) GetName() string

func (CodeChangeTest) Run

func (test CodeChangeTest) Run(ctx context.Context, t *testing.T)

type HTTPGetTest

type HTTPGetTest struct {
	Name     string
	Endpoint string
	Expected []byte
}

func (HTTPGetTest) GetName

func (test HTTPGetTest) GetName() string

func (HTTPGetTest) Run

func (test HTTPGetTest) Run(_ context.Context, t *testing.T)

type HTTPPostTest

type HTTPPostTest struct {
	Name     string
	Endpoint string
	Body     interface{}
}

func (HTTPPostTest) GetName

func (test HTTPPostTest) GetName() string

func (HTTPPostTest) Run

func (test HTTPPostTest) Run(_ context.Context, t *testing.T)

type Test

type Test interface {
	Run(context.Context, *testing.T)
	GetName() string
}

Jump to

Keyboard shortcuts

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