{ "info": { "author": "Denis Korytkin", "author_email": "dkorytkin@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6" ], "description": "\n# wrapAPI\n\nRequests wrapper for API testing\n\n\n## Usage\n\n### conftest\nconftest.py\n```python\nimport pytest\n\nfrom wrapapi import Application, Settings\n\n\n@pytest.fixture(scope='session')\ndef settings() -> Settings:\n config = Settings()\n config.base_url = 'http://localhost:5555'\n config.headers['Autorization'] = 'Basic secret'\n return config\n\n\n@pytest.fixture(scope='session')\ndef client(settings) -> Application:\n app = Application(settings)\n client = app.create()\n yield client\n client.close()\n\n\n@pytest.fixture(scope='function')\ndef app(client) -> Application:\n yield client\n client.report.build()\n\n```\ntests with pytest fixture\n```python\ndef test_main(app):\n response = app.get('/api/main', status=200)\n response.json.should.be.is_instance(list)\n\n\ndef test_main_item(app):\n response = app.get('/api/main/666', status=200)\n response.json.should.be.equal({'id': 666, 'name': 'test'})\n\n```\n\n### TestCase\n\nwith TestSuite\n```python\nfrom wrapapi import TestSuite\n\n\nclass TestExample(TestSuite):\n\n def test_main(self):\n response = self.app.get('/api/main', status=200)\n response.json.should.be.is_instance(list)\n\n def test_main_item(self):\n response = self.app.get('/api/main/666', status=200)\n response.json.should.be.equal({'id': 666, 'name': 'test'})\n\n```\n\n### AssertionErrors\nIf we have any errors, raise exception with full request data:\n```bash\nE AssertionError: \nE ===========================================================\nE GET: http://localhost:5555/api/main/666\nE -----------------------------------------------------------\nE Status: 200\nE Body: None\nE Headers: {'Date': 'Wed, 27 Mar 2019 12:17:48 GMT', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Content-Length': '51'....}\nE ===========================================================\nE Not equal: {'id': 666, 'name': 'test'} == {'id': 1, 'name': 'test'}\nE -> expected: {'id': 666, 'name': 'test'}\nE -> current: {'id': 1, 'name': 'test'}\n\n```\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "", "keywords": "API,API testing,requests testing,requests wrapper", "license": "", "maintainer": "", "maintainer_email": "", "name": "wrapAPI", "package_url": "https://pypi.org/project/wrapAPI/", "platform": "", "project_url": "https://pypi.org/project/wrapAPI/", "project_urls": null, "release_url": "https://pypi.org/project/wrapAPI/0.0.1/", "requires_dist": [ "requests", "pytest ; extra == 'test'" ], "requires_python": "", "summary": "Requests wrapper for API testing", "version": "0.0.1" }, "last_serial": 4992764, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "7bcf8cf9b6fdc90b0e67f1a55e66a3d8", "sha256": "30566d70b37a29e089636016e304dc4f6669704d616c21feaba3eb474fcbbbd7" }, "downloads": -1, "filename": "wrapAPI-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "7bcf8cf9b6fdc90b0e67f1a55e66a3d8", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 9148, "upload_time": "2019-03-27T13:21:10", "url": "https://files.pythonhosted.org/packages/ca/84/bf5ef92950b84cfc344b0c50e5cc56a11e1e8a3deb0b3707187ca9527b6e/wrapAPI-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "97afbb6005906fca6cf7f69e2c1846a6", "sha256": "fac82fae31a38df6d21d4b403188918a107d9a6c395e71c9ee165e620e04a369" }, "downloads": -1, "filename": "wrapAPI-0.0.1.tar.gz", "has_sig": false, "md5_digest": "97afbb6005906fca6cf7f69e2c1846a6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6705, "upload_time": "2019-03-27T13:21:13", "url": "https://files.pythonhosted.org/packages/a5/05/19a251c4fbfee36323cd958ab17849eb6545bd91941ace946030589c2611/wrapAPI-0.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "7bcf8cf9b6fdc90b0e67f1a55e66a3d8", "sha256": "30566d70b37a29e089636016e304dc4f6669704d616c21feaba3eb474fcbbbd7" }, "downloads": -1, "filename": "wrapAPI-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "7bcf8cf9b6fdc90b0e67f1a55e66a3d8", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 9148, "upload_time": "2019-03-27T13:21:10", "url": "https://files.pythonhosted.org/packages/ca/84/bf5ef92950b84cfc344b0c50e5cc56a11e1e8a3deb0b3707187ca9527b6e/wrapAPI-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "97afbb6005906fca6cf7f69e2c1846a6", "sha256": "fac82fae31a38df6d21d4b403188918a107d9a6c395e71c9ee165e620e04a369" }, "downloads": -1, "filename": "wrapAPI-0.0.1.tar.gz", "has_sig": false, "md5_digest": "97afbb6005906fca6cf7f69e2c1846a6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6705, "upload_time": "2019-03-27T13:21:13", "url": "https://files.pythonhosted.org/packages/a5/05/19a251c4fbfee36323cd958ab17849eb6545bd91941ace946030589c2611/wrapAPI-0.0.1.tar.gz" } ] }