{ "info": { "author": "Kamil Kujawinski", "author_email": "kamil@kujawinski.net", "bugtrack_url": null, "classifiers": [ "Environment :: Console", "Environment :: Web Environment", "Intended Audience :: Developers", "License :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Topic :: Internet", "Topic :: Internet :: WWW/HTTP :: Dynamic Content", "Topic :: Software Development :: Testing" ], "description": "===========\nWS Recorder\n===========\n\nDescription\n===========\n\nWSRecorder is a tool that provides proxy for your webservices. This tool allows to record and serve webservices samples.\nThe proxy is python function decorator. Samples are XSLT templates, which transform requests to expected replies.\nSamples have a form of decision trees, where in each node a test against configured xpath is performed; tree paths\ndepend on an xpath value for each request.\n\nChanges\n=======\n\n- 0.9.9:\n * using functions from lxml-xpath2-functions, you can access them with prefix xp2f\n\n\nUsage\n=====\n\nExample::\n\n params = {\n 'request_msg_name': '//request/*',\n 'reply_envelope_body': '//reply/*',\n 'messages': {\n 'msg1': [\n '//msg1/param1/text()',\n '//msg1/param2/text()'\n ],\n },\n 'output_dir': '/tmp/tmpdir/,\n }\n\n recorder = WSRecorder(mode=WSRecorder.Mode.RECORD, **params)\n cls.record_service = staticmethod(recorder.decorator(web_service_mockup))\n\nDocumentation\n=============\n\nObject of this class provides proxy for webservices. First you need to create an object of this class to use the proxy.\n\nWSRecorder.__init__\n-------------------\n\n\n``WSRecorder.__init__(self, request_msg_name, reply_envelope_body, output_dir, mode=None, output_filename='{0}.output', messages={})``:\n\nInitializes object of WSRecord.\n\n**mode**: parameter that controls behaviour of WSRecorder. Default value: ``WSRecorder.Mode.TRANSPARENT``.\n\nAvailable values:\n\n- ``WSRecorder.Mode.RECORD`` - records samples according to configuration into output directory.\n- ``WSRecorder.Mode.OVERRIDE`` - records sample according to configuration, overrides already recorded message.\n- ``WSRecorder.Mode.SERVE`` - serves recorded samples, doesn't hit the webservices, if fails raise ``NotRecordedException``.\n- ``WSRecorder.Mode.TRANSPARENT`` - doesn't use recorded samples, just hit the webservices.\n- ``WSRecorder.Mode.SERVE_TRANSPARENT`` - try to use recorded samples, if fails just hit the webservices.\n- ``WSRecorder.Mode.SERVE_RECORD`` - try to use recorded samples, if fails just hit the webservices and record replies.\n\n\n**request_msg_name**: xpath that indicates the name in the request message. Message name is afterwards used to configure\nspecific handler for each message and to save replies of different messages in different files.\n\n**reply_envelope_body**: xpath that indicates body of reply message. Reply body is that part of a reply message, which\nis meaningful and can change in replies. Everything \"above\" the reply body is constant and reused in every reply\nmessage. Reply message can not have empty node for ``reply_envelope_body`` xpath, in such situation exception\n``NotRecordedException`` is raised.\n\n**output_dir**: directory where recorded samples are stored in a ``RECORD``/``OVERRIDE`` modes and from which recorded\nsamples are read in a ``SERVE`` mode.\n\n**output_filename**: pattern for saved files. Default value ``{}.output``. Message name is passed to ``string.format``\nfunction.\n\n**messages**: dictionary of configured messages. Keys in dictionary are messages names, values are list of xpaths,\nwhich are sequential checked against request message.\n\n**pretty_print**: boolean param determines whether output file should be pretty printed. Default value: ``False``.\n\nExceptions:\n-----------\n\n``ConfigurationException`` is raised during initialization when:\n\n - Request message name is not proper xpath,\n - Reply envelope body is not proper xpath,\n - Chosen mode is not allowed,\n - Any xpath for message is not proper xpath,\n - Output directory path is not proper.\n\n\nWSRecorder.decorator\n--------------------\n\n``WSRecorder.decorator(self, fn, mode=None)``:\n\nProxy for your webservice. It requires that as a first argument the decorated function takes a request message\nand returns a reply of message. Requests and replies of messages must be Python ``string`` or ``lxml.etree._Element``.\n\nExceptions:\n-----------\n\n``NotRecordedException`` is raised in SERVE mode if sample doesn't have reply for given request.\n\n``ConfigurationException`` is raised in proxy function when:\n - configured xpaths doesn't match those saved in recorded sample, raise in modes: RECORD, OVERRIDE,\n SERVE_RECORD,\n - given mode is not allowed.\n - XPath with reply envelope body is not proper for given message reply.\n\nExample usage\n-------------\n\n::\n\n @obj.decorator\n def webservice1(request):\n return reply", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://bitbucket.org/kkujawinski/ws-recorder", "keywords": null, "license": "LGPL", "maintainer": null, "maintainer_email": null, "name": "ws-recorder", "package_url": "https://pypi.org/project/ws-recorder/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/ws-recorder/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://bitbucket.org/kkujawinski/ws-recorder" }, "release_url": "https://pypi.org/project/ws-recorder/0.9.9/", "requires_dist": null, "requires_python": null, "summary": "Tool to record Web Service calls and to serve them afterwards", "version": "0.9.9" }, "last_serial": 1035814, "releases": { "0.9.0": [ { "comment_text": "", "digests": { "md5": "4829532afa1f1ae6cb388562a32a1ab3", "sha256": "0a7573c4a6a9f696eaaa3575e044b0620053c1668d3636dff92d8b4e84db76a5" }, "downloads": -1, "filename": "ws-recorder-0.9.0.tar.gz", "has_sig": false, "md5_digest": "4829532afa1f1ae6cb388562a32a1ab3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8202, "upload_time": "2014-03-06T05:36:09", "url": "https://files.pythonhosted.org/packages/4c/a9/32b491bf0a703ef278a1fef495f9554698523c05dc893fb8f48d470d6999/ws-recorder-0.9.0.tar.gz" } ], "0.9.1": [ { "comment_text": "", "digests": { "md5": "1dc94f83cd35f78c686e89c91d412028", "sha256": "9121a72f539507a97e0688ac6fe7c5649040a59d385427bc046021cc3a9ff059" }, "downloads": -1, "filename": "ws-recorder-0.9.1.tar.gz", "has_sig": false, "md5_digest": "1dc94f83cd35f78c686e89c91d412028", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8438, "upload_time": "2014-03-13T19:45:01", "url": "https://files.pythonhosted.org/packages/a9/a1/75558a0580f2ed74c7f517b136a57a6b93ae49f3d8e2f61089f7c0230e53/ws-recorder-0.9.1.tar.gz" } ], "0.9.8": [ { "comment_text": "", "digests": { "md5": "0b9480d46084f337b2e8a4d0ca5ae786", "sha256": "0e7d44b387e979377c598c04cb80194b8070f65b5d861125b23b9149db64ecd6" }, "downloads": -1, "filename": "ws-recorder-0.9.8.tar.gz", "has_sig": false, "md5_digest": "0b9480d46084f337b2e8a4d0ca5ae786", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9687, "upload_time": "2014-03-18T05:46:49", "url": "https://files.pythonhosted.org/packages/ce/52/2dbf6467d3d846b7827d7328ee672db772568310d27d7701afdb3966dc2b/ws-recorder-0.9.8.tar.gz" } ], "0.9.9": [ { "comment_text": "", "digests": { "md5": "fbeec9b5a9691ecbc178e7ea0b7f23da", "sha256": "919e8b56ad48a72720c1b66c918b3462f293acfc362f3f1968e3dd3ab7677d17" }, "downloads": -1, "filename": "ws-recorder-0.9.9.tar.gz", "has_sig": false, "md5_digest": "fbeec9b5a9691ecbc178e7ea0b7f23da", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9804, "upload_time": "2014-03-20T05:25:24", "url": "https://files.pythonhosted.org/packages/44/13/b6fbcb7b3ad998e84bc4c118615726cf24301a9505c86381502814bb427e/ws-recorder-0.9.9.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "fbeec9b5a9691ecbc178e7ea0b7f23da", "sha256": "919e8b56ad48a72720c1b66c918b3462f293acfc362f3f1968e3dd3ab7677d17" }, "downloads": -1, "filename": "ws-recorder-0.9.9.tar.gz", "has_sig": false, "md5_digest": "fbeec9b5a9691ecbc178e7ea0b7f23da", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9804, "upload_time": "2014-03-20T05:25:24", "url": "https://files.pythonhosted.org/packages/44/13/b6fbcb7b3ad998e84bc4c118615726cf24301a9505c86381502814bb427e/ws-recorder-0.9.9.tar.gz" } ] }