{ "info": { "author": "Livio Ribeiro", "author_email": "livioribeiro@outlook.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Web Environment", "Framework :: CherryPy", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Internet :: WWW/HTTP", "Topic :: Internet :: WWW/HTTP :: Dynamic Content", "Topic :: Software Development :: Testing" ], "description": "===================\ncherrypy.authorizer\n===================\n\nTest utilities for cherrypy. Can be run under py.test, nosetests or unittest.\n\nBased on `code provided by Sylvain Hellegouarch `_\n\nThe response returned by the methods on the class ``lribeiro.cherrypy.test.CPTestCase`` is added two properties:\n``status_code`` and ``text``, providing an easier way to retrieve the response body as a string and the status code as\nan integer\n\nThe class ``lribeiro.cherrypy.test.CPTestCase`` provides facilities to setup serverless testing and has helper methods\nto perform requests.\n\nYou need to provide a ``root`` class attribute when using ``CPTestCase`` that will be the root of your test application.\n\nYou can also provide a ``preserve_cookies`` class attribute to control whether the cookies must be resent with every\nrequest. This is useful when testing authentication. The default value is ``True``.\n\n======== ==============\nmethod description\n======== ==============\nget() GET request\npost() POST request\nput() PUT request\ndelete() DELETE request\nhead() HEAD request\npatch() PATCH request\n======== ==============\n\nThese methods call the ``request()`` method with the specified http method set passing any additional parameter.\n\nThe ``request()`` method accepts the following parameters (none of them is required - defaults in parenthesis):\n\n============= ======================================================================\nparameter description\n============= ======================================================================\npath path to request ('/')\nmethod method to request ('GET')\napp_path path of the application to make requests against ('')\nscheme http or https ('http')\nproto http version ('HTTP/1.1')\ndata dict contaning data to post on request body (None)\nheaders dict contaning request headers to be sent (None)\ncookies dict contaning cookies to be sent (None)\nauto_redirect whether to follow redirect responses (False)\n\\*\\*kwargs data to be sent in querystring or request body, in case of POST or PUT\n============= ======================================================================\n\nIn addition to the request methods, the are assertion methods:\n\n=================== ======================================================================================================================\nmethod description\n=================== ======================================================================================================================\nassert_status assert a specific https status. Constants for http status can be found in ``lribeiro.cherrypy.test.httpstatus`` module\nassert_ok shortcut to ``assert_status(httpstatus.OK)``\nassert_not_found shortcut to ``assert_status(httpstatus.NOT_FOUND)``\nassert_error shortcut to ``assert_status(httpstatus.INTERNAL_SERVER_ERROR)``\nassert_redirect assert the the response is a redirect\nassert_redirect_to assert the the response is a redirect and verifies the Location of the redirect\nassert_not_redirect assert that a response is not a redirect\nassert_contains assert that the response body contains a string\nassert_not_contains assert that the response body does not contain a string\nassert_body assert that the response body is equals to a string\nassert_header assert that the a response header has a specific value\nassert_has_header assert that the response has a header\nassert_cookie assert that the a response cookie has a specific value\nassert_has_cookie assert that the response has a cookie\nassert_path assert that the request path_info is the same as the one given\n=================== ======================================================================================================================\n\nThere is also pythonic versions of the ``assert_`` methods in the ``unittest.TestCase`` class, like:\n\n- CPTestCase.assert_true\n- CPTestCase.assert_raises\n- CPTestCase.assert_in\n\nand so on.\n\nDeveloped under Python3.4 and tested against Python2.7, Python3.4 and pypy.\n\nExample:\n--------\n\n.. sourcecode:: python\n\n import cherrypy\n\n from lribeiro.cherrypy.test import CPTestCase\n\n\n class Root:\n @cherrypy.expose\n def index(self):\n return 'index'\n\n @cherrypy.expose\n def post(self, name):\n return 'name = ' + name\n\n @cherrypy.expose\n def redir(self, to)\n raise cherrypy.HTTPRedirect(to)\n\n\n class TestTests(CPTestCase):\n root = Root()\n\n def test_index(self):\n self.get('/')\n self.assert_ok()\n self.assert_not_redirect()\n\n def test_post(self):\n self.post('/post', name='Lorem Ipsum')\n self.assert_contains('Lorem Ipsum')\n\n def test_redir(self):\n self.get('/redir', to='/some/page')\n self.assert_redirect('/some/page')\n\n def test_pythonic_assertion(self):\n self.assert_true(True)\n self.assert_equal('equal', 'equal')\n with self.assert_raises(Exception):\n raise Exception()", "description_content_type": null, "docs_url": null, "download_url": null, "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://bitbucket.org/livioribeiro/cherrypy-test", "keywords": "cherrypy,test,unittest,py.test,nosetests", "license": "BSD License", "maintainer": null, "maintainer_email": null, "name": "lribeiro.cherrypy.test", "package_url": "https://pypi.org/project/lribeiro.cherrypy.test/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/lribeiro.cherrypy.test/", "project_urls": { "Homepage": "http://bitbucket.org/livioribeiro/cherrypy-test" }, "release_url": "https://pypi.org/project/lribeiro.cherrypy.test/1.1.0/", "requires_dist": null, "requires_python": null, "summary": "Test utilities for CherryPy", "version": "1.1.0" }, "last_serial": 1710281, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "bd68e6158308cd0fb348a8987bfc24cd", "sha256": "f2509eb9b6f0ada3427eee6ee0e4f451b5fb138f7a565d0e470c28b2f1cd178e" }, "downloads": -1, "filename": "lribeiro.cherrypy.test-1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "bd68e6158308cd0fb348a8987bfc24cd", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 10615, "upload_time": "2014-09-15T17:00:11", "url": "https://files.pythonhosted.org/packages/a2/21/f406dfee1612c26ec70294726d1dd73681e6576f5a0f512026b8b18f87d6/lribeiro.cherrypy.test-1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "65cb9b6565e14d13b16e93c8ea609ab9", "sha256": "75d8b669595321e35d71609460952a1c63c5d757606fa046e1a1e1d9af064e99" }, "downloads": -1, "filename": "lribeiro.cherrypy.test-1.0.tar.gz", "has_sig": false, "md5_digest": "65cb9b6565e14d13b16e93c8ea609ab9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7155, "upload_time": "2014-09-15T17:00:14", "url": "https://files.pythonhosted.org/packages/16/cc/4c0e6bf05a7ddce18bba045ba6b5a474f71c18c17c51be288ef58499e29f/lribeiro.cherrypy.test-1.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "1b1a3c843a10d9895898f14ab1bebbd7", "sha256": "5b6e36270398eb6cd1cb4488bd8ddb36495037f45399cd2715fc3efdea605cba" }, "downloads": -1, "filename": "lribeiro.cherrypy.test-1.0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "1b1a3c843a10d9895898f14ab1bebbd7", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 10645, "upload_time": "2014-09-16T11:45:02", "url": "https://files.pythonhosted.org/packages/86/f0/aac88ffe4cd0d652727bbcf86dffd605c61ffdd5f16d65b6e3da83b6fe5b/lribeiro.cherrypy.test-1.0.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "bca0effdd544c289da5808959f3ec00c", "sha256": "af73f1c2454008da64f0f317dd7f94b79b42f67fd4266054f0fc0d5a087b9eda" }, "downloads": -1, "filename": "lribeiro.cherrypy.test-1.0.1.tar.gz", "has_sig": false, "md5_digest": "bca0effdd544c289da5808959f3ec00c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7160, "upload_time": "2014-09-16T11:45:04", "url": "https://files.pythonhosted.org/packages/88/2a/968858d3d74c0783c7781c088a6b61f2c73f47d5b1f714b3c9d098c9eedc/lribeiro.cherrypy.test-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "5614982cf74f899a8ee369289f68e48a", "sha256": "ad199265e3e6aae62f299ca96ed7948394d2540268dffdf3c7b1e6a4fc7c2016" }, "downloads": -1, "filename": "lribeiro.cherrypy.test-1.0.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "5614982cf74f899a8ee369289f68e48a", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 10675, "upload_time": "2014-09-16T12:13:48", "url": "https://files.pythonhosted.org/packages/45/a2/d9698fbf23beef7387d6cbf41c72a062935d4e16fb547ad75d338c3e3e41/lribeiro.cherrypy.test-1.0.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b34d24ea9f6537dce59704523f6adc3c", "sha256": "fc41cedbcd5b8e2745b69bfdce2fd8c7074090eb392934c632b9da1ed3291923" }, "downloads": -1, "filename": "lribeiro.cherrypy.test-1.0.2.tar.gz", "has_sig": false, "md5_digest": "b34d24ea9f6537dce59704523f6adc3c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7191, "upload_time": "2014-09-16T12:13:45", "url": "https://files.pythonhosted.org/packages/9f/eb/413ebcafa5720489e273d85dc08b7ed9e941a20e5e9794a0777e123daed5/lribeiro.cherrypy.test-1.0.2.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "ed441e43e4bd8d0707ccc68fb641147f", "sha256": "1407259715e07542340e62c3db3f38156de8606782e2aeff5004553817157b55" }, "downloads": -1, "filename": "lribeiro.cherrypy.test-1.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "ed441e43e4bd8d0707ccc68fb641147f", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 12830, "upload_time": "2014-09-18T15:57:02", "url": "https://files.pythonhosted.org/packages/95/0e/9efad41f245dbbb67090e098c9a567f6f98bda68f3d32b7f16b858e16e05/lribeiro.cherrypy.test-1.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "06922b56c73ed3252324b3de368256f6", "sha256": "3ee31f578fbc15ad49ac8e731cb911788068f868d6282be0ded499163495f1f1" }, "downloads": -1, "filename": "lribeiro.cherrypy.test-1.1.0.tar.gz", "has_sig": false, "md5_digest": "06922b56c73ed3252324b3de368256f6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10714, "upload_time": "2014-09-18T15:56:58", "url": "https://files.pythonhosted.org/packages/cb/82/5a70d3d8c88541214d73654823a6a10f21cdfd466e3d95a7f33b9c56780e/lribeiro.cherrypy.test-1.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ed441e43e4bd8d0707ccc68fb641147f", "sha256": "1407259715e07542340e62c3db3f38156de8606782e2aeff5004553817157b55" }, "downloads": -1, "filename": "lribeiro.cherrypy.test-1.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "ed441e43e4bd8d0707ccc68fb641147f", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 12830, "upload_time": "2014-09-18T15:57:02", "url": "https://files.pythonhosted.org/packages/95/0e/9efad41f245dbbb67090e098c9a567f6f98bda68f3d32b7f16b858e16e05/lribeiro.cherrypy.test-1.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "06922b56c73ed3252324b3de368256f6", "sha256": "3ee31f578fbc15ad49ac8e731cb911788068f868d6282be0ded499163495f1f1" }, "downloads": -1, "filename": "lribeiro.cherrypy.test-1.1.0.tar.gz", "has_sig": false, "md5_digest": "06922b56c73ed3252324b3de368256f6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10714, "upload_time": "2014-09-18T15:56:58", "url": "https://files.pythonhosted.org/packages/cb/82/5a70d3d8c88541214d73654823a6a10f21cdfd466e3d95a7f33b9c56780e/lribeiro.cherrypy.test-1.1.0.tar.gz" } ] }