Google App Engine 1.8.6 がリリースされました。 そしてついに、Go版で単体テスト用のパッケージ appengine/aetest が追加されました! AppEngineのローカルでの開発サーバはPythonで実装されており、Pythonの開発サーバがGoアプリを呼び出すように動作しています。この仕組み上、Goの単体テストからAppEngineのAPIを呼び出すことが困難でした。 新たに追加された appengine/aetest を使うと、以下のように単体テストを書くことができます。 package foo_test import ( "testing" "appengine/memcache" "appengine/aetest" ) func TestFoo(t *testing.T) { c, err := aetest.NewContext(nil) if