1// +build appengine
2
3package aetest
4
5import "appengine/aetest"
6
7// NewInstance launches a running instance of api_server.py which can be used
8// for multiple test Contexts that delegate all App Engine API calls to that
9// instance.
10// If opts is nil the default values are used.
11func NewInstance(opts *Options) (Instance, error) {
12	aetest.PrepareDevAppserver = PrepareDevAppserver
13	var aeOpts *aetest.Options
14	if opts != nil {
15		aeOpts = &aetest.Options{
16			AppID: opts.AppID,
17			StronglyConsistentDatastore: opts.StronglyConsistentDatastore,
18		}
19	}
20	return aetest.NewInstance(aeOpts)
21}
22