I was wondering if anyone had recommendations for testing bottle-based
applications?
Mostly I'm a bit unsure about how to properly set up the bottle
environment to emulate a request. I could probably work it out, but
thought I'd ask here first to see if people have already had to deal
with this. I tend to use nosetests for unit testing, but I can use
something different if it suits better.
Any help appreciated!
Joel Pitt, PhD | http://ferrouswheel.me | +64 21 101 7308
NetEmpathy Co-founder | http://netempathy.com
OpenCog Developer | http://opencog.org
Board member, Humanity+ | http://humanityplus.org
I'll answer my own question, turns out it's pretty simple to start
with! All you need to do is:
from bottle import app
result = app().handle('/',method='GET')
I've yet to find out what will start happening if I want to test file
uploads and other more complicated things. I'll update this thread if
I learn more stuff that could be useful.
Cheers,
J
It would be really great!
Thanks
--
Roman Yakovenko
C++ Python language binding
http://www.language-binding.net/
Testing WSGI applications is a common task. There are several libraries
and testing frameworks available: http://wsgi.org/wsgi/Testing
I use a custom toolbox for testing bottle itself. It is not pretty, but
it works well:
http://github.com/defnull/bottle/blob/master/test/tools.py
--
Mit freundlichen Grüßen
Marcel Hellkamp