Skip to main content

A unit testing tool for Python's bottle library.

Project description

image

image

Boddle

A unit testing tool for Python’s bottle library. We wrote this for our own testing purposes at https://www.hvst.com. Thanks brenguyen711 for the great name!

Install

sudo pip install boddle

Usage

Assuming you have a bottle route like this:

@bottle.get('/woot')
def woot():
  return bottle.request.params['name']

You can unit test it like:

import unittest
from boddle import boddle

class TestIt(unittest.TestCase):
  def testWoot(self):
    with boddle(params={'name':'derek'}):
      self.assertEqual(woot(), 'derek')

See `example.py <example.py>`__.

Testing

$ git clone https://github.com/keredson/boddle.git
$ cd boddle
$ python tests.py
..........
----------------------------------------------------------------------
Ran 10 tests in 0.001s

OK

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for boddle, version 0.2.1
Filename, size File type Python version Upload date Hashes
Filename, size boddle-0.2.1.tar.gz (2.5 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page