{ "info": { "author": "Osvaldo Santana Neto", "author_email": "wsgitest@osantana.me", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Topic :: Software Development :: Libraries", "Topic :: Software Development :: Testing" ], "description": "wsgitest\n========\n\n|Build Status| |Coverage Status|\n\n\nYou can use `wsgitest` to start a HTTP server for a WSGI application and\ncontrol the process:\n\n.. code-block:: python\n\n @Request.application\n def application(request):\n return Response('Hello World!')\n\n class AppServerTestCase(TestCase):\n def test_hello_app(self):\n server = WSGITestServer.create(application)\n try:\n response = requests.get(server.application_url)\n self.assertEqual(response.status_code, 200)\n self.assertEqual(response.content, b\"Hello World!\")\n finally:\n server.terminate()\n\n def test_hello_app_reference(self):\n server = WSGITestServer.create(\"tests.test_server.application\")\n try:\n response = requests.get(server.application_url)\n self.assertEqual(response.status_code, 200)\n self.assertEqual(response.content, b\"Hello World!\")\n finally:\n server.terminate()\n\nThe method `WSGITestServer.create()` initialize a `multiprocessing.Process`_\nand wait for the server startup.\n\nYou can use server as a context manager to avoid that tests get stucked when\nyou forget to \"terminate\" server:\n\n.. code-block:: python\n\n @Request.application\n def application(request):\n return Response('Hello World!')\n\n class AppServerTestCase(TestCase):\n def test_hello_app(self):\n with WSGITestServer(application) as server:\n response = requests.get(server.application_url)\n self.assertEqual(response.status_code, 200)\n self.assertEqual(response.content, b\"Hello World!\")\n\nYou can also start server with an specific host/ip or TCP port:\n\n.. code-block:: python\n\n @Request.application\n def application(request):\n return Response('Hello World!')\n\n class AppServerTestCase(TestCase):\n def test_hello_app(self):\n with WSGITestServer(application, \"0.0.0.0\", 5000) as server:\n response = requests.get(server.application_url)\n self.assertEqual(response.status_code, 200)\n self.assertEqual(response.content, b\"Hello World!\")\n\n\n.. _multiprocessing.Process: https://docs.python.org/3/library/multiprocessing.html#the-process-class\n\n\n.. |Build Status| image:: https://travis-ci.org/osantana/wsgitest.png?branch=master\n :target: https://travis-ci.org/osantana/wsgitest\n.. |Coverage Status| image:: https://coveralls.io/repos/osantana/wsgitest/badge.svg?branch=master\n :target: https://coveralls.io/r/osantana/wsgitest?branch=master\n", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/osantana/wsgitest/tarball/0.2.0", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/osantana/wsgitest", "keywords": "testing test server", "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "wsgitest", "package_url": "https://pypi.org/project/wsgitest/", "platform": "any", "project_url": "https://pypi.org/project/wsgitest/", "project_urls": { "Download": "https://github.com/osantana/wsgitest/tarball/0.2.0", "Homepage": "http://github.com/osantana/wsgitest" }, "release_url": "https://pypi.org/project/wsgitest/0.2.0/", "requires_dist": null, "requires_python": null, "summary": "Standalone WSGI server for running tests purpose.", "version": "0.2.0" }, "last_serial": 1566886, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "14240b05173d10bc11e47b2b787803e2", "sha256": "f46f76d310516feab32a17c21335c4af08a11220a7988546aecae0bd49f87e07" }, "downloads": -1, "filename": "wsgitest-0.0.1.tar.gz", "has_sig": false, "md5_digest": "14240b05173d10bc11e47b2b787803e2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3566, "upload_time": "2015-05-28T19:08:41", "url": "https://files.pythonhosted.org/packages/1e/04/88c3956747a9d9234057150e79d3ab1a1ccfc7c6d4c89224dda356c138ce/wsgitest-0.0.1.tar.gz" } ], "0.1.0": [ { "comment_text": "", "digests": { "md5": "5ae477bd052181e10687c090a856ad3c", "sha256": "1ed2dab56917ec973fc98f604c08d40f20bed16289674d57845554169bd7b8f1" }, "downloads": -1, "filename": "wsgitest-0.1.0.tar.gz", "has_sig": false, "md5_digest": "5ae477bd052181e10687c090a856ad3c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3625, "upload_time": "2015-05-28T19:19:54", "url": "https://files.pythonhosted.org/packages/f0/5c/51c9626497cb157e5191f8a3800017738eac257409c26d46b3ba534be79b/wsgitest-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "435f9e3f4b06adc7352fd1b11fb58e9c", "sha256": "f46e076d8b62ac43b8cb4f56940fb575124e78d34bf977aae7d97a97ac764b3b" }, "downloads": -1, "filename": "wsgitest-0.1.1.tar.gz", "has_sig": false, "md5_digest": "435f9e3f4b06adc7352fd1b11fb58e9c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3624, "upload_time": "2015-05-28T19:21:20", "url": "https://files.pythonhosted.org/packages/11/b2/84d270d9e438812ea47019f412c8c17013a5c9ca8c7ecfb306ed49409dfa/wsgitest-0.1.1.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "d296d148926e038c4e70b6ce886928da", "sha256": "06137e227d944837538d2d9a919c29fa31b9f4501337ca81827dd1a1b344e52c" }, "downloads": -1, "filename": "wsgitest-0.2.0.tar.gz", "has_sig": false, "md5_digest": "d296d148926e038c4e70b6ce886928da", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4169, "upload_time": "2015-05-28T20:03:38", "url": "https://files.pythonhosted.org/packages/b0/98/33d8053aab30d308d57e7c484cf6d4ed5a5ec3d15a73389f6c0e7c4ee25e/wsgitest-0.2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "d296d148926e038c4e70b6ce886928da", "sha256": "06137e227d944837538d2d9a919c29fa31b9f4501337ca81827dd1a1b344e52c" }, "downloads": -1, "filename": "wsgitest-0.2.0.tar.gz", "has_sig": false, "md5_digest": "d296d148926e038c4e70b6ce886928da", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4169, "upload_time": "2015-05-28T20:03:38", "url": "https://files.pythonhosted.org/packages/b0/98/33d8053aab30d308d57e7c484cf6d4ed5a5ec3d15a73389f6c0e7c4ee25e/wsgitest-0.2.0.tar.gz" } ] }