{ "info": { "author": "John Kristensen", "author_email": "john@jerrykan.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Web Environment", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Topic :: Internet :: WWW/HTTP :: WSGI", "Topic :: Software Development :: Testing" ], "description": "wsgi-liveserver\r\n===============\r\nwsgi-liveserver provides a simple LiverServerTestCase class that can be used to\r\nhelp start a web server in the background to serve a WSGI compliant application\r\nfor use with testing. Generally it will be used in conjuction with something\r\nlike Selenium to perform a series of functional tests using a browser.\r\n\r\nLicensed under the GNU GPL v3\r\n\r\nCopyright (c) 2013 John Kristensen (unless explicitly stated otherwise).\r\n\r\n\r\nInstallation and Dependencies\r\n-----------------------------\r\nInstall wsgi-liveserver with ``pip install wsgi-liveserver`` or just `download\r\nwsgi_liveserver.py `_ and place it\r\nin your project directory. There are no dependencies other than the Python\r\nStandard Library.\r\n\r\n\r\nUsage\r\n-----\r\nThe wsgi-liveserver ``LiveServerTestCase`` can be used instead of\r\n``unittest.TestCase`` for any tests that require a running web server. Simply\r\ndefine a ``create_app()`` method that returns the WSGI application that you want\r\nto have started up in the background, then write your tests as normal.\r\n``LiveServerTestCase`` will handle starting and stopping the server for you.\r\n\r\nPort Range\r\n~~~~~~~~~~\r\nBy default ``LiveServerTestCase`` will attempt to listen on the first available\r\nport in the range 8080-8090 (inclusive). If you wish the LiveServer to attempt\r\nto listen on a different range of ports this can be done by setting the\r\n``port_range`` class attribute (see the example below).\r\n\r\n\r\nExample\r\n-------\r\nThe following is a very basic example of using wsgi-liveserver with the\r\n`wsgiref demo_app\r\n`_:\r\n\r\n.. code-block:: python\r\n\r\n import unittest\r\n from wsgiref.simple_server import demo_app\r\n from selenium import webdriver\r\n from wsgi_liveserver import LiveServerTestCase\r\n\r\n class SimpleTest(LiveServerTestCase):\r\n port_range = (9001, 9010) # default is (8080, 8090)\r\n\r\n def create_app(self):\r\n return demo_app\r\n\r\n def setUp(self):\r\n self.driver = webdriver.Firefox()\r\n\r\n def tearDown(self):\r\n self.driver.close()\r\n\r\n def test_page_title(self):\r\n self.driver.get(self.url_base())\r\n self.assertTrue('Hello world!' in self.driver.page_source)\r\n\r\n if __name__ == '__main__':\r\n unittest.main()\r\n\r\n\r\nAnother simple but fully functional `bottle `_ web\r\napplication with tests can be found at:\r\nhttps://github.com/jerrykan/bottle-selenium\r\n\r\n\r\nContact\r\n-------\r\nSend your questions, comments, patches to John Kristensen ", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/jerrykan/wsgi-liveserver/", "keywords": "wsgi liveserver", "license": "GPLv3", "maintainer": "", "maintainer_email": "", "name": "wsgi-liveserver", "package_url": "https://pypi.org/project/wsgi-liveserver/", "platform": "any", "project_url": "https://pypi.org/project/wsgi-liveserver/", "project_urls": { "Homepage": "http://github.com/jerrykan/wsgi-liveserver/" }, "release_url": "https://pypi.org/project/wsgi-liveserver/0.3.1/", "requires_dist": null, "requires_python": "", "summary": "start/stop WSGI applications in the background for functional testing", "version": "0.3.1" }, "last_serial": 2152468, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "df87cb27ad8de1dd672183f083ebee79", "sha256": "857cd9b82db649b477ba31c79aa7838b6543226dd29380f6983b6a8c3c69b9d1" }, "downloads": -1, "filename": "wsgi-liveserver-0.1.tar.gz", "has_sig": false, "md5_digest": "df87cb27ad8de1dd672183f083ebee79", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2973, "upload_time": "2013-03-21T12:58:38", "url": "https://files.pythonhosted.org/packages/c2/e0/170dab080e148ee1309a4b1afff30cec9933b6385c4d2572de5513847b56/wsgi-liveserver-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "29b2236a0002b83078c3b59a507c29b5", "sha256": "7d4358cc2435fb25e17cab3ff961504b8dbddd37915b6cb973992afb988f6ab6" }, "downloads": -1, "filename": "wsgi-liveserver-0.2.tar.gz", "has_sig": false, "md5_digest": "29b2236a0002b83078c3b59a507c29b5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2926, "upload_time": "2015-03-04T03:39:27", "url": "https://files.pythonhosted.org/packages/e8/00/53aa8781e23182a2f935e976e1b087bfab4c2cbd3eb6525776adaa3cd8ec/wsgi-liveserver-0.2.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "ac1b01f837a36d9dc0f95b55260c5841", "sha256": "676c71fe200a1d04d68e1005dd1fafe7a79851603ace4ba5d69c74ecf6f899d1" }, "downloads": -1, "filename": "wsgi-liveserver-0.3.tar.gz", "has_sig": false, "md5_digest": "ac1b01f837a36d9dc0f95b55260c5841", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3026, "upload_time": "2015-10-07T13:15:14", "url": "https://files.pythonhosted.org/packages/27/33/25f7cd9d65938c684639026d4967a89f0fda3b322f63c244f6e3b6fbc32a/wsgi-liveserver-0.3.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "19d55fa23903e189080a07ad54802c6b", "sha256": "130a03c8aa9abe31d9c77ed6d1fd13a59bb159b8b044420fdcc1c6bdb571513a" }, "downloads": -1, "filename": "wsgi-liveserver-0.3.1.tar.gz", "has_sig": false, "md5_digest": "19d55fa23903e189080a07ad54802c6b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16506, "upload_time": "2016-06-06T05:06:29", "url": "https://files.pythonhosted.org/packages/e2/80/b9b21f2eba48fe1a3922a98090ae9782ad610402229eadb0eb272ab56941/wsgi-liveserver-0.3.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "19d55fa23903e189080a07ad54802c6b", "sha256": "130a03c8aa9abe31d9c77ed6d1fd13a59bb159b8b044420fdcc1c6bdb571513a" }, "downloads": -1, "filename": "wsgi-liveserver-0.3.1.tar.gz", "has_sig": false, "md5_digest": "19d55fa23903e189080a07ad54802c6b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16506, "upload_time": "2016-06-06T05:06:29", "url": "https://files.pythonhosted.org/packages/e2/80/b9b21f2eba48fe1a3922a98090ae9782ad610402229eadb0eb272ab56941/wsgi-liveserver-0.3.1.tar.gz" } ] }