test

package
v0.0.0-...-f26991d Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2015 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

This package provides test utilities for 'goapp test' DO NOT import this package in the deployment app.

Index

Constants

This section is empty.

Variables

View Source
var JsonMacros = template.FuncMap{
	"today": func() string {
		var t = time.Now()
		return wcg.FormatDate(t)
	},
	"now": func() string {
		var t = time.Now()
		return wcg.FormatDate(t)
	},
}

Functions

func CleanupDatastore

func CleanupDatastore(ctx appengine.Context) error

func DatastoreFixture

func DatastoreFixture(ctx appengine.Context, path string, bindings interface{}) error

func FixtureFromFile

func FixtureFromFile(ctx appengine.Context, path string, bindings interface{}) error

func FixtureFromMap

func FixtureFromMap(ctx appengine.Context, arr []map[string]interface{}) error

func NewAssert

func NewAssert(t *testing.T) *httptest.Assert

func ResetFixtureFromFile

func ResetFixtureFromFile(ctx appengine.Context, path string, bindings interface{}) error

func RunTestServer

func RunTestServer(f func(*TestServer))

Types

type JsonSaver

type JsonSaver map[string]interface{}

func (JsonSaver) Load

func (js JsonSaver) Load(c <-chan datastore.Property) error

func (JsonSaver) Save

func (js JsonSaver) Save(c chan<- datastore.Property) error

type TestServer

type TestServer struct {
	Context aetest.Context
}

func NewTestServer

func NewTestServer() *TestServer

func (*TestServer) Delete

func (ts *TestServer) Delete(path string) *httptest.TestRequest

func (*TestServer) Get

func (ts *TestServer) Get(path string) *httptest.TestRequest

func (*TestServer) Post

func (ts *TestServer) Post(path string, body string) *httptest.TestRequest

func (*TestServer) PostForm

func (ts *TestServer) PostForm(path string, data url.Values) *httptest.TestRequest

func (*TestServer) Put

func (ts *TestServer) Put(path string, body string) *httptest.TestRequest

func (*TestServer) PutForm

func (ts *TestServer) PutForm(path string, data url.Values) *httptest.TestRequest

func (*TestServer) Request

func (ts *TestServer) Request(method string, path string, body io.Reader) *httptest.TestRequest

Jump to

Keyboard shortcuts

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