instance_classic.go 587 B

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