Documentation ¶
Index ¶
- Variables
- type HTTPFixture
- type HTTPFixtures
- func (fixtures HTTPFixtures) Apply(t *testing.T, callback func(ctx context.Context, cfg *config.Config))
- func (fixtures HTTPFixtures) ApplyClient(t *testing.T, ...)
- func (fixtures HTTPFixtures) Client(t *testing.T) (*client.DatabricksClient, *httptest.Server)
- func (fixtures HTTPFixtures) Config(t *testing.T) (*config.Config, *httptest.Server)
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)
Click to show internal directories.
Click to hide internal directories.