{ "info": { "author": "Vilibald Wan\u010da", "author_email": "vilibald.wanca@oracle.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Console", "Environment :: Web Environment", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", "Topic :: Software Development :: Build Tools", "Topic :: Software Development :: Testing" ], "description": "===================================================\nPython Hooks Bridge for Dredd API Testing Framework\n===================================================\n\n.. image:: https://travis-ci.org/apiaryio/dredd-hooks-python.svg?branch=master\n :target: https://travis-ci.org/apiaryio/dredd-hooks-python\n\nAbout\n=====\n\nThis package contains a bridge between `Dredd API Testing Framework`_\nand Python environment to ease implementation of testing hooks\nprovided by Dredd_. Write Dredd_ hooks in Python to glue together `API\nBlueprint`_ with your Python project\n\n.. _Dredd API Testing Framework: http://dredd.readthedocs.org/en/latest/\n.. _Dredd: http://dredd.readthedocs.org/en/latest/\n.. _API Blueprint: https://apiblueprint.org/\n\n\n\nUsage example:\n\n.. code-block:: python\n\n import dredd_hooks as hooks\n\n @hooks.before_all\n def foo(transactions):\n for t in transactions:\n t['request']['headers']['content-type'] = 'application/json'\n\nDownload\n========\n\nYou can see all the `available versions`__ at PyPI_.\n\n__ http://pypi.python.org/pypi/dredd_hooks\n\n\nFrom source (tar.gz or checkout)\n--------------------------------\n\nUnpack the archive, enter the ``dredd-hooks-python`` directory and run::\n\n python setup.py install\n\n\nSetuptools/PyPI_\n----------------\n\nAlternatively it can be installed from PyPI_, either manually\ndownloading the files and installing as described above or using::\n\n pip install dredd_hooks\n\n.. _PyPI: http://pypi.python.org/pypi\n\nUsage\n=====\n\n1. Create a hook file in ``hooks.py``:\n\n.. code-block:: python\n\n import dredd_hooks as hooks\n\n @hooks.before(\"Machines > Machines collection > Get Machines\")\n def before_hook(transaction):\n transaction['skip'] = \"true\"\n\n\n2. Run it with Dredd::\n\n $ dredd apiary.apib localhost:3000 --language python --hookfiles ./hooks.py\n\nAPI\n===\n\nModule ``dredd_hooks`` defines following decorators ``before``, ``after``,\n``before_all``, ``after_all``, ``before_each``, ``after_each``,\n``before_validation``, ``before_each_validation``. ``before``,\n``before_validation`` and ``after`` hooks are identified by `transaction\nname\n`_.\n\nYou can combine those decorators together. So one function can be used\nfor different hooks but be aware that some hooks have a list of all\ntransactions as an argument and not a single transaction.\n\n.. code-block:: python\n\n import dredd_hooks as hooks\n\n @hooks.after_all\n @hooks.before_all\n @hooks.before_each\n @hooks.after_each\n @hooks.before_validation('Machines > Machines collection > Get Machines')\n @hooks.before(\"Machines > Machines collection > Get Machines\")\n @hooks.after(\"Machines > Machines collection > Get Machines\")\n def multi_hook_function(trans):\n if isinstance(trans, list):\n print('called with list of transactions')\n else:\n if trans['name'] == 'Machines > Machines collection > Get Machines':\n trans['skip'] = 'true'\n\n\nUsage is very similar to `sync JS hooks API\n`_\n\nContributing\n============\n1. Fork it\n2. Create your feature branch (``git checkout -b my-newfeature``)\n3. Commit your changes (``git commit -am 'Add some feature'``)\n4. Push (``git push origin my-new-feature``)\n5. Create a new Pull Request\n\nTesting\n=======\n\nDon't forget about tests, see ``test`` directory. The project uses\n``unittest`` package and ``tox``.\n\nFor integration test with Dredd_ interface the project uses ruby based\n`aruba `_ so to get it running make\nsure you have Ruby installed and then do::\n\n $ bundle install\n\nAfter the setup you can run the test easily with::\n\n $ bundle exec cucumber\n\nMore details about the integration test can be found in the\n`dredd-hooks-template repo\n`_\n\n\n:copyright: Copyright (c) 2015 Apiary Czech Republic, s.r.o.\n:license: MIT, see LICENSE for details.", "description_content_type": "", "docs_url": null, "download_url": "http://pypi.python.org/pypi/dredd_hooks", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/apiaryio/dredd-hooks-python/", "keywords": "HTTP API testing Dredd", "license": "MIT License", "maintainer": "Apiary", "maintainer_email": "support@apiary.io", "name": "dredd_hooks", "package_url": "https://pypi.org/project/dredd_hooks/", "platform": "any", "project_url": "https://pypi.org/project/dredd_hooks/", "project_urls": { "Download": "http://pypi.python.org/pypi/dredd_hooks", "Homepage": "https://github.com/apiaryio/dredd-hooks-python/" }, "release_url": "https://pypi.org/project/dredd_hooks/0.2.0/", "requires_dist": null, "requires_python": "", "summary": "Python Hooks Bridge for Dredd API Testing Framework", "version": "0.2.0" }, "last_serial": 3748530, "releases": { "0.0.1rc1": [ { "comment_text": "", "digests": { "md5": "580bfb7ca722ffdb0e255786975937b7", "sha256": "e1bd0d2d6b3d53ce19d14288028683b1f5c481c127cc0852c46960f83022eab8" }, "downloads": -1, "filename": "dredd_hooks-0.0.1rc1.tar.gz", "has_sig": false, "md5_digest": "580bfb7ca722ffdb0e255786975937b7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6742, "upload_time": "2015-07-07T16:20:14", "url": "https://files.pythonhosted.org/packages/2d/e2/14b3d85f80efc515f05a5d51e7e6c315a8f37c49eb1a2c4a3906c86e4727/dredd_hooks-0.0.1rc1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "228c3669cf79cbceca1d64d18bdc0f4d", "sha256": "1752765a76bcfe8fa373b14ffdff3425f732b43ee1f7291f0fb1c4a15944e9d5" }, "downloads": -1, "filename": "dredd_hooks-0.0.2.tar.gz", "has_sig": false, "md5_digest": "228c3669cf79cbceca1d64d18bdc0f4d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6734, "upload_time": "2015-07-07T16:23:10", "url": "https://files.pythonhosted.org/packages/65/2d/fa9c15cfa3ebe870e4556da4894edbdbc3a12a03f7e0414aca7898aad236/dredd_hooks-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "76216f1f83c305130d3abb4e9ad614f1", "sha256": "8dc395c056cfcf2a55c9d0ecf853e3734381a8395cc5dc8e2f4e2d06b5b5b5e2" }, "downloads": -1, "filename": "dredd_hooks-0.0.3.tar.gz", "has_sig": false, "md5_digest": "76216f1f83c305130d3abb4e9ad614f1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11131, "upload_time": "2016-01-26T09:05:04", "url": "https://files.pythonhosted.org/packages/34/0d/fc59a3a04f1c5d23e30a06a7b684ca35948769d31f3ed13d09914a8bd415/dredd_hooks-0.0.3.tar.gz" } ], "0.1.0": [ { "comment_text": "", "digests": { "md5": "0b1f23c0905b58ce8d967748cfdf439b", "sha256": "5c5e88630643436472772fa66c791d1cfade7a4ed217a15dc118e7fd2196ed9e" }, "downloads": -1, "filename": "dredd_hooks-0.1.0.tar.gz", "has_sig": false, "md5_digest": "0b1f23c0905b58ce8d967748cfdf439b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7349, "upload_time": "2016-07-05T16:44:32", "url": "https://files.pythonhosted.org/packages/fa/60/9b155df278ab44c1cf5bc28306ee99faf3a1209ff7929a37dc48714dab7e/dredd_hooks-0.1.0.tar.gz" } ], "0.1.0.dev20160705": [ { "comment_text": "", "digests": { "md5": "14402394af3fa9794a95a2a3c3e75b7f", "sha256": "c91cdb63240010990c2471e4a588541953dce8281b2e8fa3a5b652f5496fb308" }, "downloads": -1, "filename": "dredd_hooks-0.1.0.dev20160705.tar.gz", "has_sig": false, "md5_digest": "14402394af3fa9794a95a2a3c3e75b7f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7404, "upload_time": "2016-07-05T15:43:57", "url": "https://files.pythonhosted.org/packages/5c/66/cc3f54339c85c5d2e94c8e33fe0ff53df482e10e36b32515f1a18a841335/dredd_hooks-0.1.0.dev20160705.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "5b0cd08e7d5e8687b7be2ef914fa41e6", "sha256": "d212dd9d295fbb7f15ad1577fe69462621c5ee3c006eb5bce1796489a49e0db4" }, "downloads": -1, "filename": "dredd_hooks-0.1.1.tar.gz", "has_sig": false, "md5_digest": "5b0cd08e7d5e8687b7be2ef914fa41e6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7933, "upload_time": "2016-10-25T17:40:59", "url": "https://files.pythonhosted.org/packages/0e/42/478547b3155075b2a587ce9756e802863a04d0bb889156e9e280e06c9cff/dredd_hooks-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "4c80642a0a11019d88ba6dbd6a837e39", "sha256": "dfa316af87501fbe439558746c5b815817d09a3843c4d7439b2546891a6d8a2b" }, "downloads": -1, "filename": "dredd_hooks-0.1.2.tar.gz", "has_sig": false, "md5_digest": "4c80642a0a11019d88ba6dbd6a837e39", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7952, "upload_time": "2016-12-09T11:10:24", "url": "https://files.pythonhosted.org/packages/cc/61/4cdaa6cd426cc63e456b692313acafd81673db09152c3ef36a13465d56a8/dredd_hooks-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "4f80a12a777da47d48656f65a0ccfc44", "sha256": "0cb16059099258b203ef84f3fa9690b76a991ce57a3f1c30c35a018b996c0e87" }, "downloads": -1, "filename": "dredd_hooks-0.1.3.tar.gz", "has_sig": false, "md5_digest": "4f80a12a777da47d48656f65a0ccfc44", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8008, "upload_time": "2017-03-08T17:24:14", "url": "https://files.pythonhosted.org/packages/97/f9/2e244309af8205a7ad155e687f17e18c34c299359cfde06c951e7cbcf393/dredd_hooks-0.1.3.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "e14f0f50a9c82894e405bb27d5b84d18", "sha256": "7d0527ee269d716126de912098b6d8750fcb3755232cb902e5a360f1921df780" }, "downloads": -1, "filename": "dredd_hooks-0.2.0.tar.gz", "has_sig": false, "md5_digest": "e14f0f50a9c82894e405bb27d5b84d18", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9823, "upload_time": "2018-04-09T12:47:29", "url": "https://files.pythonhosted.org/packages/0c/f4/23234e8b673f8d4eec3c9dd79fb7e420b029c7064dea6c49ba7e22242ba8/dredd_hooks-0.2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "e14f0f50a9c82894e405bb27d5b84d18", "sha256": "7d0527ee269d716126de912098b6d8750fcb3755232cb902e5a360f1921df780" }, "downloads": -1, "filename": "dredd_hooks-0.2.0.tar.gz", "has_sig": false, "md5_digest": "e14f0f50a9c82894e405bb27d5b84d18", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9823, "upload_time": "2018-04-09T12:47:29", "url": "https://files.pythonhosted.org/packages/0c/f4/23234e8b673f8d4eec3c9dd79fb7e420b029c7064dea6c49ba7e22242ba8/dredd_hooks-0.2.0.tar.gz" } ] }