mirror of
https://github.com/caddyserver/caddy.git
synced 2024-12-23 22:27:38 -05:00
6fde3632ef
The vendor/ folder was created with the help of @FiloSottile's gvt and vendorcheck. Any dependencies of Caddy plugins outside this repo are not vendored. We do not remove any unused, vendored packages because vendorcheck -u only checks using the current build configuration; i.e. packages that may be imported by files toggled by build tags of other systems. CI tests have been updated to ignore the vendor/ folder. When Go 1.9 is released, a few of the go commands should be revised to again use ./... as it will ignore the vendor folder by default.
42 lines
921 B
Go
42 lines
921 B
Go
/*
|
|
Package aetest provides an API for running dev_appserver for use in tests.
|
|
|
|
An example test file:
|
|
|
|
package foo_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"google.golang.org/appengine/memcache"
|
|
"google.golang.org/appengine/aetest"
|
|
)
|
|
|
|
func TestFoo(t *testing.T) {
|
|
ctx, done, err := aetest.NewContext()
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
defer done()
|
|
|
|
it := &memcache.Item{
|
|
Key: "some-key",
|
|
Value: []byte("some-value"),
|
|
}
|
|
err = memcache.Set(ctx, it)
|
|
if err != nil {
|
|
t.Fatalf("Set err: %v", err)
|
|
}
|
|
it, err = memcache.Get(ctx, "some-key")
|
|
if err != nil {
|
|
t.Fatalf("Get err: %v; want no error", err)
|
|
}
|
|
if g, w := string(it.Value), "some-value" ; g != w {
|
|
t.Errorf("retrieved Item.Value = %q, want %q", g, w)
|
|
}
|
|
}
|
|
|
|
The environment variable APPENGINE_DEV_APPSERVER specifies the location of the
|
|
dev_appserver.py executable to use. If unset, the system PATH is consulted.
|
|
*/
|
|
package aetest
|