package tests

import "github.com/coreos/etcd/tests"

Index

Functions

func Delete

func Delete(url string, bodyType string, body io.Reader) (*http.Response, error)

func DeleteForm

func DeleteForm(url string, data url.Values) (*http.Response, error)

func Get

func Get(url string) (*http.Response, error)

func NewHTTPClient

func NewHTTPClient() *http.Client

Creates a new HTTP client with KeepAlive disabled.

func Post

func Post(url string, bodyType string, body io.Reader) (*http.Response, error)

func PostForm

func PostForm(url string, data url.Values) (*http.Response, error)

func Put

func Put(url string, bodyType string, body io.Reader) (*http.Response, error)

func PutForm

func PutForm(url string, data url.Values) (*http.Response, error)

func ReadBody

func ReadBody(resp *http.Response) []byte

Reads the body from the response and closes it.

func ReadBodyJSON

func ReadBodyJSON(resp *http.Response) map[string]interface{}

Reads the body from the response and parses it as JSON.

func RunServer

func RunServer(f func(*server.Server))

Starts a server in a temporary directory.

Source Files

http_utils.go server_utils.go

Directories

PathSynopsis
tests/functional
tests/mock
Version
v0.2.0
Published
Dec 23, 2013
Platform
darwin/amd64
Imports
11 packages
Last checked
3 hours ago

Tools for package owners.