The test cases are failing with this patch set
.[24/Jan/2014:14:59:05] HTTP Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/cherrypy/_cprequest.py", line
656, in respond
response.body = self.handler()
File "/usr/lib/python2.7/dist-packages/cherrypy/lib/encoding.py",
line 188, in __call__
self.body = self.oldhandler(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/cherrypy/_cpdispatch.py", line
34, in __call__
return self.callable(*self.args, **self.kwargs)
File "/home/alinefm/kimchi/src/kimchi/control/base.py", line 275, in
index
return self.create(*args)
File "/home/alinefm/kimchi/src/kimchi/control/base.py", line 213, in
create
return res.get()
File "/home/alinefm/kimchi/src/kimchi/control/base.py", line 164, in get
return kimchi.template.render(get_class_name(self), self.data)
File "/home/alinefm/kimchi/src/kimchi/template.py", line 89, in render
paths = cherrypy.request.app.root.paths
AttributeError: 'Drawings' object has no attribute 'paths'
127.0.0.1 - - [24/Jan/2014:14:59:05] "POST /plugins/sample/rectangles
HTTP/1.1" 500 805 "" ""
F[24/Jan/2014:14:59:05] ENGINE Bus STOPPING
[24/Jan/2014:14:59:05] ENGINE HTTP Server
cherrypy._cpwsgi_server.CPWSGIServer(('127.0.0.1', 56824)) shut down
[24/Jan/2014:14:59:05] ENGINE HTTP Server
cherrypy._cpwsgi_server.CPWSGIServer(('127.0.0.1', 40264)) shut down
[24/Jan/2014:14:59:05] ENGINE Stopped thread 'Session cleanup'.
[24/Jan/2014:14:59:05] ENGINE Stopped thread '_TimeoutMonitor'.
[24/Jan/2014:14:59:05] ENGINE Bus STOPPED
[24/Jan/2014:14:59:05] ENGINE Bus EXITING
[24/Jan/2014:14:59:05] ENGINE Bus EXITED
======================================================================
ERROR: test_collection (test_mockmodel.MockModelTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/alinefm/kimchi/tests/test_mockmodel.py", line 60, in
test_collection
self.assertEquals('[]', c.index())
File "/home/alinefm/kimchi/src/kimchi/control/base.py", line 266, in
index
return self.get(filter_params)
File "/home/alinefm/kimchi/src/kimchi/control/base.py", line 257, in get
return kimchi.template.render(get_class_name(self), data)
File "/home/alinefm/kimchi/src/kimchi/template.py", line 89, in render
paths = cherrypy.request.app.root.paths
AttributeError: 'Drawings' object has no attribute 'paths'
======================================================================
ERROR: test_resource (test_mockmodel.MockModelTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/alinefm/kimchi/tests/test_mockmodel.py", line 77, in
test_resource
self.assertEquals('{}', r.index())
File "/home/alinefm/kimchi/src/kimchi/control/base.py", line 115, in
index
return self.get()
File "/home/alinefm/kimchi/src/kimchi/control/base.py", line 164, in get
return kimchi.template.render(get_class_name(self), self.data)
File "/home/alinefm/kimchi/src/kimchi/template.py", line 89, in render
paths = cherrypy.request.app.root.paths
AttributeError: 'Drawings' object has no attribute 'paths'
======================================================================
FAIL: test_development_env (test_exception.ExceptionTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/alinefm/kimchi/tests/test_exception.py", line 98, in
test_development_env
self.assertEquals(msg, resp.get('reason'))
AssertionError: 'Delete is not allowed for root' != u'Delete is not
allowed for kimchiroot'
======================================================================
FAIL: test_production_env (test_exception.ExceptionTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/alinefm/kimchi/tests/test_exception.py", line 68, in
test_production_env
self.assertEquals(msg, resp.get('reason'))
AssertionError: 'Delete is not allowed for root' != u'Delete is not
allowed for kimchiroot'
======================================================================
FAIL: test_installed_paths (test_config.ConfigTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/alinefm/kimchi/tests/test_config.py", line 37, in
test_installed_paths
'/usr/lib/python2.7/site-packages/kimchi')
AssertionError: '/usr/lib/python2.7/dist-packages/kimchi' !=
'/usr/lib/python2.7/site-packages/kimchi'
======================================================================
FAIL: test_installed_plugin_paths (test_config.ConfigTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/alinefm/kimchi/tests/test_config.py", line 61, in
test_installed_plugin_paths
'/usr/lib/python2.7/site-packages/kimchi/plugins/sample')
AssertionError: '/usr/lib/python2.7/dist-packages/kimchi/plugins/sample'
!= '/usr/lib/python2.7/site-packages/kimchi/plugins/sample'
======================================================================
FAIL: test_rectangles (test_plugin.PluginTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/alinefm/kimchi/tests/test_plugin.py", line 89, in
test_rectangles
self._create_rectangle_and_assert('small', 10, 8)
File "/home/alinefm/kimchi/tests/test_plugin.py", line 74, in
_create_rectangle_and_assert
self.assertEquals(201, resp.status)
AssertionError: 201 != 500
----------------------------------------------------------------------
Ran 136 tests in 108.748s
FAILED (failures=5, errors=2)
On 01/24/2014 04:31 AM, Mark Wu wrote:
This series of patches reorganize kimchi's path vars generation
code
to allow plugin use kimchi s ui handler.
Changes:
v2:
Rebase
Remove the optimization for plugin paths since it just have a few
instantiations.
Mark Wu (3):
Reorganize the kimchi's paths gereneration code
Add test cases for paths generation code
Allow plugin use kimchi's ui handler
src/kimchi/cachebust.py | 4 +-
src/kimchi/config.py.in | 155 +++++++++++++++++++-----------------------------
src/kimchi/root.py | 23 ++++---
src/kimchi/server.py | 14 +++--
src/kimchi/template.py | 17 ++++--
src/kimchi/utils.py | 6 +-
src/kimchid.in | 7 ++-
tests/test_config.py | 73 +++++++++++++++++++++++
tests/test_plugin.py | 4 +-
9 files changed, 178 insertions(+), 125 deletions(-)
create mode 100644 tests/test_config.py