#1214: nosetests fresh quickstarted project: Failed to create client object:
Daemon not running
--------------------+-------------------------------------------------------
Reporter: jeffk | Owner: anonymous
Type: defect | Status: new
Priority: normal | Milestone:
Component: tests | Version: trunk
Severity: normal | Keywords: quickstart nosetests daemon client object
--------------------+-------------------------------------------------------
http://groups.google.com/group/turbogears-
trunk/browse_thread/thread/f40123adad2a9e91
Updated bug report to trunk r2262, satisfied recent FormEncode==dev
dependencies etc.
Running nosetests on a fresh quickstarted project (r2262 trunk) gives the
following error. The quickstarted project itself runs (except that I now
notice the same error in the startup message), as does toolbox.
{{{
/software/tgprojects $ tg-admin quickstart -p tgtest tgtest
Do you need Identity (usernames/passwords) in this project? [no]
(...)
writing dependency_links to tgtest.egg-info/dependency_links.txt
reading manifest file 'tgtest.egg-info/SOURCES.txt'
writing manifest file 'tgtest.egg-info/SOURCES.txt'
}}}
{{{
/software/tgprojects/tgtest $ python start-tgtest.py
2006-12-22 13:02:23,100 cherrypy.msg INFO CONFIG: Server parameters:
2006-12-22 13:02:23,101 cherrypy.msg INFO CONFIG: server.environment:
development
2006-12-22 13:02:23,101 cherrypy.msg INFO CONFIG: server.log_to_screen:
True
2006-12-22 13:02:23,102 cherrypy.msg INFO CONFIG: server.log_file:
2006-12-22 13:02:23,102 cherrypy.msg INFO CONFIG: server.log_tracebacks:
True
2006-12-22 13:02:23,102 cherrypy.msg INFO CONFIG:
server.log_request_headers: True
2006-12-22 13:02:23,103 cherrypy.msg INFO CONFIG:
server.protocol_version: HTTP/1.0
2006-12-22 13:02:23,103 cherrypy.msg INFO CONFIG: server.socket_host:
2006-12-22 13:02:23,104 cherrypy.msg INFO CONFIG: server.socket_port:
8080
2006-12-22 13:02:23,104 cherrypy.msg INFO CONFIG: server.socket_file:
2006-12-22 13:02:23,104 cherrypy.msg INFO CONFIG: server.reverse_dns:
False
2006-12-22 13:02:23,105 cherrypy.msg INFO CONFIG:
server.socket_queue_size: 5
2006-12-22 13:02:23,105 cherrypy.msg INFO CONFIG: server.thread_pool: 10
Failed to create client object: Daemon not running
2006-12-22 13:02:23,492 cherrypy.msg INFO HTTP: Serving HTTP on
http://localhost:8080/
}}}
{{{
/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 2.430s
FAILED (failures=1)
}}}
{{{
I'm running turbogears trunk on linux python 2.4.4:
/software/svn/turbogears $ svn info
URL: http://www.turbogears.org/svn/turbogears/trunk
Revision: 2262
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
/software/svn/FormEncode
./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
./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
}}}
{{{
(from TurboGears-trunk list) 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 think it's missing the cherrypy.response object. Editing the
quickstarted test to subsitute <title> in place of <TITLE>:
/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.807s
FAILED (failures=1)
}}}
{{{
/software/tgprojects/tgtest $ cat 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)
Type "copyright", "credits" or "license" for more information.
IPython 0.7.2 -- An enhanced Interactive Python.
? -> Introduction to IPython's features.
%magic -> Information about IPython's 'magic' % functions.
help -> Python's own help system.
object? -> Details about 'object'. ?object also works, ?? prints more.
In [1]: from turbogears import testutil
22/Dec/2006:12:59:24 CONFIG INFO Server parameters:
22/Dec/2006:12:59:24 CONFIG INFO server.environment: development
22/Dec/2006:12:59:24 CONFIG INFO server.log_to_screen: True
22/Dec/2006:12:59:24 CONFIG INFO server.log_file:
22/Dec/2006:12:59:24 CONFIG INFO server.log_tracebacks: True
22/Dec/2006:12:59:24 CONFIG INFO server.log_request_headers: True
22/Dec/2006:12:59:24 CONFIG INFO server.protocol_version: HTTP/1.0
22/Dec/2006:12:59:24 CONFIG INFO server.socket_host:
22/Dec/2006:12:59:24 CONFIG INFO server.socket_port: 8080
22/Dec/2006:12:59:24 CONFIG INFO server.socket_file:
22/Dec/2006:12:59:24 CONFIG INFO server.reverse_dns: False
22/Dec/2006:12:59:24 CONFIG INFO server.socket_queue_size: 5
22/Dec/2006:12:59:24 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]: print cherrypy.response.body[0]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=utf-8"></meta>
<title>500 Internal error</title>
<style type="text/css">
#powered_by {
margin-top: 20px;
border-top: 2px solid black;
font-style: italic;
}
#traceback {
color: red;
}
</style>
</head>
<body>
<h2>500 Internal error</h2>
<p>The server encountered an unexpected condition which prevented
it from fulfilling the request.</p>
<pre id="traceback">Page handler: <bound method Root.index of
<tgtest.controllers.Root object at 0x86c280c>>
Traceback (most recent call last):
File "/usr/lib/python2.4/site-
packages/CherryPy-2.2.1-py2.4.egg/cherrypy/_cphttptools.py", line 105, in
_run
self.main()
File "/usr/lib/python2.4/site-
packages/CherryPy-2.2.1-py2.4.egg/cherrypy/_cphttptools.py", line 254, in
main
body = page_handler(*virtual_path, **self.params)
File "<string>", line 3, in index
File "/software/svn/turbogears/turbogears/controllers.py", line 284, in
expose
output = database.run_with_transaction(
File "<string>", line 5, in run_with_transaction
File "/software/svn/turbogears/turbogears/database.py", line 246, in
so_rwt
retval = func(*args, **kw)
File "<string>", line 5, in _expose
File "/software/svn/turbogears/turbogears/controllers.py", line 301, in
<lambda>
mapping, fragment, args, kw)))
File "/software/svn/turbogears/turbogears/controllers.py", line 341, in
_execute_func
return _process_output(output, template, format, content_type,
mapping, fragment)
File "/software/svn/turbogears/turbogears/controllers.py", line 81, in
_process_output
mapping=mapping, content_type=content_type,fragment=fragment)
File "/software/svn/turbogears/turbogears/view/base.py", line 126, in
render
return adapt_call(engine.render, **dict(info=info, format=format,
fragment=fragment, template=template, mapping=mapping))
File "/software/svn/turbogears/turbogears/util.py", line 166, in
adapt_call
return func(*args, **kw)
File "/usr/lib/python2.4/site-
packages/TurboKid-0.9.9-py2.4.egg/turbokid/kidsupport.py", line 158, in
render
tclass = self.load_template(template)
File "/usr/lib/python2.4/site-
packages/TurboKid-0.9.9-py2.4.egg/turbokid/kidsupport.py", line 128, in
load_template
mod = _compile_template(package, basename, tfile, classname)
File "/usr/lib/python2.4/site-
packages/TurboKid-0.9.9-py2.4.egg/turbokid/kidsupport.py", line 15, in
_compile_template
mod = kid.load_template(tfile, name=classname)
File "/usr/lib/python2.4/site-
packages/kid-0.9.3-py2.4.egg/kid/__init__.py", line 112, in load_template
raise Exception, "Template not found: %s (in %s)" % (
Exception: Template not found:
/software/tgprojects/tgtest/tgtest/templates/welcome.kid (in
/software/tgprojects/tgtest, /)
</pre>
<div id="powered_by">
<span>Powered by <a href="http://www.cherrypy.org">CherryPy
2.2.1</a></span>
</div>
</body>
</html>
}}}
--
Ticket URL: <http://trac.turbogears.org/turbogears/ticket/1214>
TurboGears <http://www.turbogears.org/>
TurboGears front-to-back web development
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears Tickets" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/turbogears-tickets?hl=en
-~----------~----~----~----~------~----~------~--~---