Documentation
¶
Index ¶
- func Exec(client *http.Client, config Config, cmd *Command) ([]byte, *http.Header, int, error)
- func Execute(t *testing.T, config Config, tests []Test)
- func InitClient() *http.Client
- func Prepare(config Config, commands []Command)
- func PrepareRequest(config Config, cmd *Command) (*http.Request, error)
- func ReadResponse(resp *http.Response) ([]byte, *http.Header, int, error)
- func WaitForServer(baseURL string)
- type Command
- type Config
- type Headers
- type Test
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitClient ¶
func WaitForServer ¶ added in v0.4.0
func WaitForServer(baseURL string)
Types ¶
type Test ¶
type Test struct {
Description string
Method string
Query string
Body string
Headers Headers
// Expected is the response body to compare against, JSON-normalized.
// An empty Expected means "no expectation" and the body is NOT checked —
// so it cannot express PostgREST's `shouldRespondWith ""`. Use
// ExpectedEmpty for that.
Expected string
// ExpectedEmpty asserts the response body is empty. Needed because many
// ported PostgREST tests expect exactly that (writes default to
// `Prefer: return=minimal`), and encoding it as `Expected: ""` silently
// degraded those tests to status-only checks.
ExpectedEmpty bool
ExpectedHeaders map[string]string
Status int
}
We don't embed Command to simplify tests writing
Click to show internal directories.
Click to hide internal directories.