我正在尝试使用nose
和noseGAE
插件测试一些 GAE 模型。
这些教程展示了如何使用本教程http://farmdev.com/projects/nosegae/webapp
中的框架设置
来运行测试。但由于我使用的是 django,所以我的是:main.py
import os
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
import django.core.handlers.wsgi
app = django.core.handlers.wsgi.WSGIHandler()
当我试图流鼻涕时:
$ nosetests --with-gae
我得到:
Traceback (most recent call last):
File "c:\Python27\Scripts\nosetests-script.py", line 8, in <module>
load_entry_point('nose==1.2.1', 'console_scripts', 'nosetests')()
File "C:\Python27\lib\site-packages\nose-1.2.1-py2.7.egg\nose\core.py", line 118, in __init__
**extra_args)
File "C:\Python27\lib\unittest\main.py", line 94, in __init__
self.parseArgs(argv)
File "C:\Python27\lib\site-packages\nose-1.2.1-py2.7.egg\nose\core.py", line 135, in parseArgs
self.config.configure(argv, doc=self.usage())
File "C:\Python27\lib\site-packages\nose-1.2.1-py2.7.egg\nose\config.py", line 338, in configure
self.plugins.configure(options, self)
File "C:\Python27\lib\site-packages\nose-1.2.1-py2.7.egg\nose\plugins\manager.py", line 284, in configure
cfg(options, config)
File "C:\Python27\lib\site-packages\nose-1.2.1-py2.7.egg\nose\plugins\manager.py", line 99, in __call__
return self.call(*arg, **kw)
File "C:\Python27\lib\site-packages\nose-1.2.1-py2.7.egg\nose\plugins\manager.py", line 167, in simple
result = meth(*arg, **kw)
File "build\bdist.win32\egg\nosegae.py", line 80, in configure
ImportError: No module named dev_appserver
我认为这是因为 django 依赖项,接下来我尝试运行单个文件:
import unittest
from google.appengine.ext import testbed
class TestServicios(unittest.TestCase):
def setUP(self):
self.testbed = testbed.Testbed()
self.testbed.activate()
self.testbed.init_datastore_v3_stub()
def tearDown(self):
self.testbed.deactivate()
if __name__ == '__main__':
unittest.main()
然后:
$ python test_models.py
和:
Traceback (most recent call last):
File "test_models.py", line 2, in <module>
from google.appengine.ext import testbed
ImportError: No module named google.appengine.ext
GAE 信息发布:1.7.3 运行时:python27
有人知道这里发生了什么吗?谢谢。