test_tools

package
v0.0.0-...-1149816 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2015 License: GPL-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Json

type Json map[string]interface{}

func (Json) Equal

func (actual Json) Equal(t *testing.T, expected Json)

type JsonList

type JsonList []Json

func (JsonList) Equal

func (actualList JsonList) Equal(t *testing.T, expectedList JsonList)

type TestApp

type TestApp struct {
	AdminUser *models.Profile
	User      *models.Profile
	NoUser    *models.Profile
	// contains filtered or unexported fields
}

func NewTestApp

func NewTestApp(t *testing.T) *TestApp

func (*TestApp) CreateProfile

func (t *TestApp) CreateProfile(name string, is_admin bool) (profile *models.Profile, err error)

func (*TestApp) Do

func (t *TestApp) Do(req *http.Request) (rec *httptest.ResponseRecorder)

func (*TestApp) ExecuteJsonRequest

func (t *TestApp) ExecuteJsonRequest(method, urlStr string, body io.Reader, p *models.Profile) (rec *httptest.ResponseRecorder)

func (*TestApp) ExecuteJsonRequestRaw

func (t *TestApp) ExecuteJsonRequestRaw(method, urlStr string, data interface{}, p *models.Profile) (rec *httptest.ResponseRecorder)

func (*TestApp) JsonResponceToListOfStringMap

func (t *TestApp) JsonResponceToListOfStringMap(rec *httptest.ResponseRecorder) JsonList

func (*TestApp) JsonResponceToStringMap

func (t *TestApp) JsonResponceToStringMap(rec *httptest.ResponseRecorder) Json

func (*TestApp) Login

func (t *TestApp) Login(req *http.Request, profile *models.Profile)

func (*TestApp) NewJsonRequest

func (t *TestApp) NewJsonRequest(method, urlStr string, body io.Reader, p *models.Profile) (req *http.Request)

func (*TestApp) Put

func (t *TestApp) Put(obj ...interface{}) (err error)

func (*TestApp) Stop

func (t *TestApp) Stop()

func (*TestApp) ToJsonBody

func (t *TestApp) ToJsonBody(data interface{}) (body io.Reader)

Jump to

Keyboard shortcuts

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