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.

Install

sudo pip install boddle

Usage

Assuming you have a bottle route like this:

@app.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')

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.

Source Distribution

boddle-0.1.0.tar.gz (2.3 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page