{ "info": { "author": "Derek Anderson", "author_email": "public@kered.org", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3" ], "description": ".. figure:: https://cloud.githubusercontent.com/assets/2049665/21398745/27452db6-c76e-11e6-8605-8e5f3301472b.png\n :alt: image\n\n image\n\nBoddle\n======\n\nA unit testing tool for Python's bottle library. We wrote this for our\nown testing purposes at https://www.hvst.com. Thanks\n`brenguyen711 `__ for the great name!\n\nInstall\n-------\n\n::\n\n sudo pip install boddle\n\nUsage\n-----\n\nAssuming you have a bottle route like this:\n\n.. code:: python\n\n @bottle.get('/woot')\n def woot():\n return bottle.request.params['name']\n\nYou can unit test it like:\n\n.. code:: python\n\n import unittest\n from boddle import boddle\n\n class TestIt(unittest.TestCase):\n def testWoot(self):\n with boddle(params={'name':'derek'}):\n self.assertEqual(woot(), 'derek')\n\nSee ```example.py`` `__.\n\nOptions\n~~~~~~~\n\nThe Bottle-specific params that are supported are:\n\n+-------------+----------+\n| Argument | Notes |\n+=============+==========+\n| ``params`` | Populate |\n| | s |\n| | ``reques |\n| | t.params |\n| | ``. |\n| | Takes a |\n| | ``dict`` |\n| | or list |\n| | of |\n| | pairs. |\n| | Useful |\n| | for both |\n| | POST and |\n| | GET |\n| | params. |\n+-------------+----------+\n| ``path`` | The path |\n| | componen |\n| | t |\n| | of the |\n| | url. |\n| | Populate |\n| | s |\n| | ``reques |\n| | t.path`` |\n| | , |\n| | which |\n| | always |\n| | has a |\n| | preceedi |\n| | ng |\n| | ``/``. |\n+-------------+----------+\n| ``method`` | POST, |\n| | GET, |\n| | etc. |\n| | Bottle |\n| | will |\n| | uppercas |\n| | e |\n| | the |\n| | value. |\n+-------------+----------+\n| ``headers`` | Any HTTP |\n| | headers. |\n| | Takes a |\n| | ``dict`` |\n| | . |\n+-------------+----------+\n| ``json`` | Takes |\n| | anything |\n| | that can |\n| | be |\n| | consumed |\n| | by |\n| | ``json.d |\n| | umps()`` |\n| | . |\n| | Also |\n| | sets the |\n| | content |\n| | type of |\n| | the |\n| | request. |\n+-------------+----------+\n| ``url`` | The full |\n| | URL, |\n| | protocol |\n| | , |\n| | domain, |\n| | port, |\n| | path, |\n| | etc. |\n| | Will be |\n| | parsed |\n| | until |\n| | its |\n| | ``urlpar |\n| | ts`` |\n| | before |\n| | populati |\n| | ng |\n| | ``reques |\n| | t.url``. |\n+-------------+----------+\n| ``body`` | The raw |\n| | body of |\n| | the |\n| | request. |\n| | Takes |\n| | either a |\n| | ``str`` |\n| | or a |\n| | file-lik |\n| | e |\n| | object. |\n| | ``str``\\ |\n| | s |\n| | will be |\n| | converte |\n| | d |\n| | into |\n| | file-lik |\n| | e |\n| | objects. |\n| | Populate |\n| | d |\n| | ``reques |\n| | t.body`` |\n| | . |\n+-------------+----------+\n| ``query`` | Populate |\n| | s |\n| | ``reques |\n| | t.query` |\n| | `. |\n| | Takes a |\n| | ``dict`` |\n| | . |\n+-------------+----------+\n\nAll other keyword arguments will be assigned to the request object. For\ninstance, we often do:\n\n.. code:: python\n\n with boddle(current_user=someone):\n # code that accesses bottle.request.current_user\n\nYou can also nest ``boddle`` calls. For instance:\n\n.. code:: python\n\n with boddle(path='/woot'):\n with boddle(params={'name':'derek'}):\n # both path and params are set here\n # only path is set here\n\n**ALL CHANGES TO ``bottle.request`` ARE REVERTED WHEN THE WITH BLOCK\nENDS.**\n\nTesting\n-------\n\n.. figure:: https://api.travis-ci.org/keredson/boddle.svg?branch=master\n :alt: image\n\n image\n\n::\n\n $ git clone https://github.com/keredson/boddle.git\n $ cd boddle\n $ python tests.py \n ............\n ----------------------------------------------------------------------\n Ran 12 tests in 0.001s\n\n OK\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/keredson/boddle", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "boddle", "package_url": "https://pypi.org/project/boddle/", "platform": "", "project_url": "https://pypi.org/project/boddle/", "project_urls": { "Homepage": "https://github.com/keredson/boddle" }, "release_url": "https://pypi.org/project/boddle/0.2.8/", "requires_dist": null, "requires_python": "", "summary": "A unit testing tool for Python's bottle library.", "version": "0.2.8" }, "last_serial": 3501320, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "77ad1c4961e37362600993deb03b7381", "sha256": "6d29d2335782f9112a6dcbb74080ae78a2b332fa851cdc78651803e5fe6be6a0" }, "downloads": -1, "filename": "boddle-0.1.0.tar.gz", "has_sig": false, "md5_digest": "77ad1c4961e37362600993deb03b7381", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2342, "upload_time": "2016-12-21T18:18:41", "url": "https://files.pythonhosted.org/packages/65/bd/a844c7f543af3df800e4353d583cd0111d9982898033eaa3188c229fec07/boddle-0.1.0.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "6b5016c88631a59148692bdd4e998f7b", "sha256": "01b681f21e13613f27f7ab663fadcaf92bd95d8fb63a66634a38ca9af0c3598c" }, "downloads": -1, "filename": "boddle-0.2.0.tar.gz", "has_sig": false, "md5_digest": "6b5016c88631a59148692bdd4e998f7b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2483, "upload_time": "2016-12-21T18:30:06", "url": "https://files.pythonhosted.org/packages/c5/c0/6ca3bf1e470b45987a8ec09eacf5bf71e006502e527bad76bd7318b2625d/boddle-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "32d8e0e3c6e5e8adc9485167664a06b8", "sha256": "6768eaae2479944cbc2dae531771a38674f20b240d021fe73d01ebf91655d866" }, "downloads": -1, "filename": "boddle-0.2.1.tar.gz", "has_sig": false, "md5_digest": "32d8e0e3c6e5e8adc9485167664a06b8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2549, "upload_time": "2016-12-21T18:54:23", "url": "https://files.pythonhosted.org/packages/14/ad/67ae0ae828c9b3c55895f822222060161d86ce1375685193a94d74cb6a9b/boddle-0.2.1.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "da256a353769cb0b56d90b6dbded2ad2", "sha256": "ed6a64b7c65b3c0b53ffcefb182b945661a2b41c531a1f867a7f10db6a997d81" }, "downloads": -1, "filename": "boddle-0.2.2.tar.gz", "has_sig": false, "md5_digest": "da256a353769cb0b56d90b6dbded2ad2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2556, "upload_time": "2016-12-21T21:50:04", "url": "https://files.pythonhosted.org/packages/8e/ff/2a9413bc9325cb484ef1bcf3f96f3db25204672aa4a77f841002e5097958/boddle-0.2.2.tar.gz" } ], "0.2.3": [ { "comment_text": "", "digests": { "md5": "fdac1c39917ed801cdc23c5a3689bf30", "sha256": "fb1d37f4fad2d059311f051792a539263dcc68fce15ecd2df7028f30c89061ca" }, "downloads": -1, "filename": "boddle-0.2.3.tar.gz", "has_sig": false, "md5_digest": "fdac1c39917ed801cdc23c5a3689bf30", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4064, "upload_time": "2017-01-26T20:32:48", "url": "https://files.pythonhosted.org/packages/5e/28/14896025840e6210d626a337fdcd084c35d9616209626798cbfdcdda2ac8/boddle-0.2.3.tar.gz" } ], "0.2.4": [ { "comment_text": "", "digests": { "md5": "7ba09d64c83663c50e72edf99b09adad", "sha256": "fb18259845430c57899ac72764327bd4f568deaaef8960a99f05352c4e0383d3" }, "downloads": -1, "filename": "boddle-0.2.4.tar.gz", "has_sig": false, "md5_digest": "7ba09d64c83663c50e72edf99b09adad", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1898, "upload_time": "2017-05-05T19:49:53", "url": "https://files.pythonhosted.org/packages/f2/4c/88115dac629e8c2312ad05546ea84e2f1d3471391bb9f4385187e93cedbb/boddle-0.2.4.tar.gz" } ], "0.2.5": [ { "comment_text": "", "digests": { "md5": "60dcc889536a43d3a8a590ef1f191137", "sha256": "173f395b6f28ecc20ffc7b94d8c499bbdd21d4c91d0abef9ad87702ca48a6c83" }, "downloads": -1, "filename": "boddle-0.2.5.tar.gz", "has_sig": false, "md5_digest": "60dcc889536a43d3a8a590ef1f191137", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1928, "upload_time": "2017-05-11T16:38:33", "url": "https://files.pythonhosted.org/packages/91/af/cfeb22de823f15c88ac348b0cf29eeb2ac0ba5aaec92e5c0cb40346f67cc/boddle-0.2.5.tar.gz" } ], "0.2.6": [ { "comment_text": "", "digests": { "md5": "400f0cb6606a0514edcb6d970df14aa0", "sha256": "2cbb543eeeb012715da0fc05eff18636d3b204b84691e58483b5c31d5219da39" }, "downloads": -1, "filename": "boddle-0.2.6.tar.gz", "has_sig": false, "md5_digest": "400f0cb6606a0514edcb6d970df14aa0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1946, "upload_time": "2017-08-01T21:16:26", "url": "https://files.pythonhosted.org/packages/5e/46/016c2df024a682d3867edcb32db4691b8421073cf505c25c975ed2fda61b/boddle-0.2.6.tar.gz" } ], "0.2.7": [ { "comment_text": "", "digests": { "md5": "5f4cec363f3e99c2fcd9995453afbe84", "sha256": "2b1883c8b572d8caaf7b4997bfa432a7bc6e6e393e953cf0d857f1692d1163cb" }, "downloads": -1, "filename": "boddle-0.2.7.tar.gz", "has_sig": false, "md5_digest": "5f4cec363f3e99c2fcd9995453afbe84", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4147, "upload_time": "2017-10-27T20:00:46", "url": "https://files.pythonhosted.org/packages/a9/af/b489b18dfd4dae2e93dec6aa49de40e2162fd41efccbf51800e57a5fee64/boddle-0.2.7.tar.gz" } ], "0.2.8": [ { "comment_text": "", "digests": { "md5": "679797f24844761b2ba28f8d2be2256f", "sha256": "9ea5800fdd0400ec8d24fe9a3380ca9795734da777a8241979357693fee46177" }, "downloads": -1, "filename": "boddle-0.2.8.tar.gz", "has_sig": false, "md5_digest": "679797f24844761b2ba28f8d2be2256f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4088, "upload_time": "2018-01-18T15:59:08", "url": "https://files.pythonhosted.org/packages/6d/4f/71d518b284f9f02941080312868fc579d0765dc71a47a23d30a417823886/boddle-0.2.8.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "679797f24844761b2ba28f8d2be2256f", "sha256": "9ea5800fdd0400ec8d24fe9a3380ca9795734da777a8241979357693fee46177" }, "downloads": -1, "filename": "boddle-0.2.8.tar.gz", "has_sig": false, "md5_digest": "679797f24844761b2ba28f8d2be2256f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4088, "upload_time": "2018-01-18T15:59:08", "url": "https://files.pythonhosted.org/packages/6d/4f/71d518b284f9f02941080312868fc579d0765dc71a47a23d30a417823886/boddle-0.2.8.tar.gz" } ] }