nosetests fresh quickstarted project: Failed to create client object: Daemon not running

5 прегледа
Пређи на прву непрочитану поруку

Jeff Kowalczyk

непрочитано,
21. 12. 2006. 00:38:2921.12.06.
– TurboGears Trunk
Running nosetests on a fresh quickstarted project (r2242 trunk) gives
the following error. The project itself runs fine, as does toolbox. Am
I missing an intervening nosetests step, or is this related to
"Something wrong after r2087" (Jorge Godoy)? Thanks.

$ tg-admin quickstart -p tgtest tgtest
Do you need Identity (usernames/passwords) in this project? [no]
(...)
writing manifest file 'tgtest.egg-info/SOURCES.txt'

/software/tgprojects $ cd tgtest/
/software/tgprojects/tgtest $ nosetests
.Failed to create client object: Daemon not running
F
======================================================================
FAIL: tgtest.tests.test_controllers.test_indextitle
----------------------------------------------------------------------
Traceback (most recent call last):
File
"/usr/lib/python2.4/site-packages/nose-0.9.1-py2.4.egg/nose/case.py",
line 52, in runTest
self.testFunc()
File "/software/tgprojects/tgtest/tgtest/tests/test_controllers.py",
line 16, in test_indextitle
assert "<TITLE>Welcome to TurboGears</TITLE>" in
cherrypy.response.body[0]
AssertionError

----------------------------------------------------------------------
Ran 2 tests in 1.825s

FAILED (failures=1)

I'm running turbogears trunk on linux python 2.4.3:

/software/svn/turbogears $ svn info
URL: http://www.turbogears.org/svn/turbogears/trunk
Revision: 2242

and it seems the dependencies are satisfied. Same error with
nose-0.9.0, FWIW.

# grep -E 'TurboJson|(...)|nose'
/usr/lib/python2.4/site-packages/easy-install.pth
./setuptools-0.6c3-py2.4.egg
./cElementTree-1.0.5_20051216-py2.4-linux-i686.egg
./elementtree-1.2.6_20050316-py2.4.egg
./simplejson-1.4-py2.4.egg
./SQLObject-0.7.1-py2.4.egg
./TurboKid-0.9.9-py2.4.egg
./TurboCheetah-0.9.5-py2.4.egg
./TurboJson-0.9.9-py2.4.egg
./FormEncode-0.6-py2.4.egg
./PasteScript-1.0-py2.4.egg
./CherryPy-2.2.1-py2.4.egg
./Genshi-0.3.6-py2.4.egg
./RuleDispatch-0.5a0.dev_r2247-py2.4-linux-i686.egg
./nose-0.9.1-py2.4.egg

Karl Guertin

непрочитано,
21. 12. 2006. 13:11:4721.12.06.
– turbogea...@googlegroups.com
On 12/21/06, Jeff Kowalczyk <jeff.ko...@gmail.com> wrote:
> Running nosetests on a fresh quickstarted project (r2242 trunk) gives
> the following error. The project itself runs fine, as does toolbox. Am
> I missing an intervening nosetests step, or is this related to
> "Something wrong after r2087" (Jorge Godoy)? Thanks.

I believe kid changed their serializer recently to output lowercase
tags rather than uppercase. That looks like the reason for the
assertion error. I never figured out why they did this.

Jeff Kowalczyk

непрочитано,
21. 12. 2006. 14:34:2921.12.06.
– TurboGears Trunk
Karl Guertin wrote:
> I believe kid changed their serializer recently to output lowercase
> tags rather than uppercase. That looks like the reason for the
> assertion error. I never figured out why they did this.

I don't think the test is running to the point where the assertion gets
tested. I think it's missing the cherrypy.response object. Editing the
quickstarted test to subsitute <title> in place of <TITLE>:

$ nosetests
.Failed to create client object: Daemon not running
F
======================================================================
FAIL: tgtest.tests.test_controllers.test_indextitle
----------------------------------------------------------------------
Traceback (most recent call last):
File
"/usr/lib/python2.4/site-packages/nose-0.9.1-py2.4.egg/nose/case.py",
line 52, in runTest
self.testFunc()
File "/software/tgprojects/tgtest/tgtest/tests/test_controllers.py",
line 16, in test_indextitle

assert "<title>Welcome to TurboGears</title>" in
cherrypy.response.body[0]
AssertionError

----------------------------------------------------------------------
Ran 2 tests in 9.714s

FAILED (failures=1)

tgtest/tests/test_controllers.py:

from turbogears import testutil
from tgtest.controllers import Root
import cherrypy

cherrypy.root = Root()

def test_method():
"the index method should return a string called now"
import types
result = testutil.call(cherrypy.root.index)
assert type(result["now"]) == types.StringType

def test_indextitle():
"The mainpage should have the right title"
testutil.createRequest("/")
assert "<title>Welcome to TurboGears</title>" in
cherrypy.response.body[0]

/software/tgprojects/tgtest $ ipython
Python 2.4.4 (#1, Nov 4 2006, 18:38:54)

In [1]: from turbogears import testutil
21/Dec/2006:14:28:21 CONFIG INFO Server parameters:
21/Dec/2006:14:28:21 CONFIG INFO server.environment: development
21/Dec/2006:14:28:21 CONFIG INFO server.log_to_screen: True
21/Dec/2006:14:28:21 CONFIG INFO server.log_file:
21/Dec/2006:14:28:21 CONFIG INFO server.log_tracebacks: True
21/Dec/2006:14:28:21 CONFIG INFO server.log_request_headers: True
21/Dec/2006:14:28:21 CONFIG INFO server.protocol_version: HTTP/1.0
21/Dec/2006:14:28:21 CONFIG INFO server.socket_host:
21/Dec/2006:14:28:21 CONFIG INFO server.socket_port: 8080
21/Dec/2006:14:28:21 CONFIG INFO server.socket_file:
21/Dec/2006:14:28:21 CONFIG INFO server.reverse_dns: False
21/Dec/2006:14:28:21 CONFIG INFO server.socket_queue_size: 5
21/Dec/2006:14:28:21 CONFIG INFO server.thread_pool: 10

In [2]: from tgtest.controllers import Root

In [3]: import cherrypy

In [4]: cherrypy.root = Root()

In [5]: def test_method():
...: "the index method should return a string called now"
...: import types
...: result = testutil.call(cherrypy.root.index)
...: assert type(result["now"]) == types.StringType
...:

In [6]: test_method()

In [7]: def test_indextitle():
...: "The mainpage should have the right title"
...: testutil.createRequest("/")
...: assert "<title>Welcome to TurboGears</title>" in
cherrypy.response.body[0]
...:

In [8]: test_indextitle()


Failed to create client object: Daemon not running

---------------------------------------------------------------------------
exceptions.AssertionError Traceback (most
recent call last)

/software/tgprojects/tgtest/<ipython console>

/software/tgprojects/tgtest/<ipython console> in test_indextitle()

AssertionError:

In [9]: testutil.createRequest("/")

In [10]: cherrypy.response.body[0]
Out[10]: '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\n<html>\n<head>\n
<meta http-equiv="Content-Type" content="text/html;
charset=utf-8"></meta>\n <title>500 Internal error</title>\n
<style type="text/css">\n #powered_by {\n margin-top: 20px;\n
border-top: 2px solid black;\n font-style: italic;\n
}\n\n #traceback {\n color: red;\n }\n
</style>\n</head>\n <body>\n <h2>500 Internal error</h2>\n
<p>The server encountered an unexpected condition which prevented
it from fulfilling the request.</p>\n <pre id="traceback">Page
handler: &lt;bound method Root.index of &lt;tgtest.controllers.Root
object at 0x864ad4c&gt;&gt;\nTraceback (most recent call last):\n File
"/usr/lib/python2.4/site-packages/CherryPy-2.2.1-py2.4.egg/cherrypy/_cphttptools.py",
line 105, in _run\n self.main()\n File
"/usr/lib/python2.4/site-packages/CherryPy-2.2.1-py2.4.egg/cherrypy/_cphttptools.py",
line 254, in main\n body = page_handler(*virtual_path,
**self.params)\n File "&lt;string&gt;", line 3, in index\n File
"/software/svn/turbogears/turbogears/controllers.py", line 284, in
expose\n output = database.run_with_transaction(\n File
"&lt;string&gt;", line 5, in run_with_transaction\n File
"/software/svn/turbogears/turbogears/database.py", line 246, in
so_rwt\n retval = func(*args, **kw)\n File "&lt;string&gt;", line
5, in _expose\n File
"/software/svn/turbogears/turbogears/controllers.py", line 301, in
&lt;lambda&gt;\n mapping, fragment, args, kw)))\n File
"/software/svn/turbogears/turbogears/controllers.py", line 341, in
_execute_func\n return _process_output(output, template, format,
content_type, mapping, fragment)\n File
"/software/svn/turbogears/turbogears/controllers.py", line 81, in
_process_output\n mapping=mapping,
content_type=content_type,fragment=fragment)\n File
"/software/svn/turbogears/turbogears/view/base.py", line 125, in
render\n return adapt_call(engine.render, **dict(info=info,
format=format, fragment=fragment, template=template,
mapping=mapping))\n File
"/software/svn/turbogears/turbogears/util.py", line 166, in
adapt_call\n return func(*args, **kw)\n File
"/usr/lib/python2.4/site-packages/TurboKid-0.9.9-py2.4.egg/turbokid/kidsupport.py",
line 158, in render\n tclass = self.load_template(template)\n File
"/usr/lib/python2.4/site-packages/TurboKid-0.9.9-py2.4.egg/turbokid/kidsupport.py",
line 128, in load_template\n mod = _compile_template(package,
basename, tfile, classname)\n File
"/usr/lib/python2.4/site-packages/TurboKid-0.9.9-py2.4.egg/turbokid/kidsupport.py",
line 15, in _compile_template\n mod = kid.load_template(tfile,
name=classname)\n File
"/usr/lib/python2.4/site-packages/kid-0.9.3-py2.4.egg/kid/__init__.py",
line 112, in load_template\n raise Exception, "Template not found:
%s (in %s)" % (\nException: Template not found:
/software/tgprojects/tgtest/tgtest/templates/welcome.kid (in
/software/tgprojects/tgtest, /)\n</pre>\n <div id="powered_by">\n
<span>Powered by <a href="http://www.cherrypy.org">CherryPy
2.2.1</a></span>\n </div>\n </body>\n</html>\n'

Одговори свима
Одговори аутору
Проследи
0 нових порука