如何在Go中使用App Engine服务的代码运行单元测试?
问题描述:
有人告诉我,对使用App Engine服务(如数据存储或memcache)的代码运行单元测试的最佳解决方案是在子进程中运行开发服务器,但我不知道如何。任何人都可以成功运行这种测试,并可以共享解决方案?
I was told the best solution to run unit tests for code that uses App Engine services such as datastore or memcache was to run the development server in a child process, but I'm not sure how. Anybody successfully ran this kind of test and can share a solution?
App Engine SDK for Go使用Python dev_appserver; 查看此主题。
App Engine SDK for Go uses the Python dev_appserver; see this thread.
答
您应该查看 Google App Engine Go测试库 by Josh Marsh。
You should check out Google App Engine Go testing library by Josh Marsh.