qa

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var HTTPFailures = []HTTPFixture{
	{
		MatchAny:     true,
		ReuseRequest: true,
		Status:       418,
		Response: apierr.APIError{
			ErrorCode:  "NONSENSE",
			StatusCode: 418,
			Message:    "I'm a teapot",
		},
	},
}

Functions

This section is empty.

Types

type HTTPFixture

type HTTPFixture struct {
	Method          string
	Resource        string
	Response        interface{}
	Status          int
	ExpectedRequest interface{}
	ReuseRequest    bool
	MatchAny        bool
}

HTTPFixture defines request structure for test

type HTTPFixtures

type HTTPFixtures []HTTPFixture

func (HTTPFixtures) Apply

func (fixtures HTTPFixtures) Apply(t *testing.T, callback func(ctx context.Context, cfg *config.Config))

HTTPFixturesApply is a helper method for executing a callback and closing emulated server after

func (HTTPFixtures) ApplyClient

func (fixtures HTTPFixtures) ApplyClient(t *testing.T, callback func(ctx context.Context, client *client.DatabricksClient))

func (HTTPFixtures) Client

func (fixtures HTTPFixtures) Client(t *testing.T) (*client.DatabricksClient, *httptest.Server)

func (HTTPFixtures) Config

func (fixtures HTTPFixtures) Config(t *testing.T) (*config.Config, *httptest.Server)

Client creates DatabricksClient for emulated HTTP server

Jump to

Keyboard shortcuts

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