lemoncheesecake-requests


Namelemoncheesecake-requests JSON
Version 0.4.0 PyPI version JSON
download
home_pagehttps://lemoncheesecake-requests.readthedocs.io
SummaryTest Storytelling for requests
upload_time2023-01-23 20:07:15
maintainer
docs_urlNone
authorNicolas Delon
requires_python>=3.7
licenseApache License (Version 2.0)
keywords qa testing lemoncheesecake requests
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            lemoncheesecake-requests
========================

.. image:: https://github.com/lemoncheesecake/lemoncheesecake-requests/actions/workflows/tests.yml/badge.svg
    :target: https://github.com/lemoncheesecake/lemoncheesecake-requests/actions/workflows/tests.yml

.. image:: https://codecov.io/gh/lemoncheesecake/lemoncheesecake-requests/branch/master/graph/badge.svg
    :target: https://codecov.io/gh/lemoncheesecake/lemoncheesecake-requests

.. image:: https://img.shields.io/pypi/v/lemoncheesecake-requests.svg
    :target: https://pypi.org/project/lemoncheesecake-requests/

.. image:: https://img.shields.io/pypi/pyversions/lemoncheesecake-requests.svg
    :target: https://pypi.org/project/lemoncheesecake-requests/

lemoncheesecake-requests provides logging facilities to `requests <https://docs.python-requests.org/>`_ for
tests written with the `lemoncheesecake <http://lemoncheesecake.io>`_ test framework.

In this example, we implement a very basic test on a Github API endpoint:

.. code-block:: python

   # suites/github.py

   import lemoncheesecake.api as lcc
   from lemoncheesecake.matching import *
   from lemoncheesecake_requests import Session, is_2xx

   @lcc.test()
   def get_org():
       session = Session(base_url="https://api.github.com")

       resp = session.get("/orgs/lemoncheesecake"). \
         require_status_code(is_2xx()). \
         check_json({
           "id": is_integer(),
           "name": equal_to("lemoncheesecake")
         })


We run the test:

.. code-block:: console

   $ lcc run
   =================================== github ====================================
    OK  1 # github.get_org

   Statistics :
    * Duration: 0.214s
    * Tests: 1
    * Successes: 1 (100%)
    * Failures: 0

And here is the report details :

.. image:: https://github.com/lemoncheesecake/lemoncheesecake-requests/blob/master/doc/_static/report-sample.png?raw=true
    :alt: test result

Installation
------------

Install through pip:

.. code-block:: console

   $ pip install lemoncheesecake-requests

lemoncheesecake-requests is compatible with Python 3.7-3.10.

Features
--------

- request/response data logging into lemoncheesecake

- response status code checking using lemoncheesecake matching mechanism

Documentation
-------------

The documentation is available on https://lemoncheesecake-requests.readthedocs.io.


Contact
-------

Bug reports and improvement ideas are welcomed in tickets.
A Google Groups forum is also available for discussions about lemoncheesecake:
https://groups.google.com/forum/#!forum/lemoncheesecake.
            

Raw data

            {
    "_id": null,
    "home_page": "https://lemoncheesecake-requests.readthedocs.io",
    "name": "lemoncheesecake-requests",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "QA testing lemoncheesecake requests",
    "author": "Nicolas Delon",
    "author_email": "nicolas.delon@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/8c/e2/eac202c9b3eb8d29502439bc2d7c54639f2be478ccfc10e19d9dc3d6b1bd/lemoncheesecake-requests-0.4.0.tar.gz",
    "platform": null,
    "description": "lemoncheesecake-requests\n========================\n\n.. image:: https://github.com/lemoncheesecake/lemoncheesecake-requests/actions/workflows/tests.yml/badge.svg\n    :target: https://github.com/lemoncheesecake/lemoncheesecake-requests/actions/workflows/tests.yml\n\n.. image:: https://codecov.io/gh/lemoncheesecake/lemoncheesecake-requests/branch/master/graph/badge.svg\n    :target: https://codecov.io/gh/lemoncheesecake/lemoncheesecake-requests\n\n.. image:: https://img.shields.io/pypi/v/lemoncheesecake-requests.svg\n    :target: https://pypi.org/project/lemoncheesecake-requests/\n\n.. image:: https://img.shields.io/pypi/pyversions/lemoncheesecake-requests.svg\n    :target: https://pypi.org/project/lemoncheesecake-requests/\n\nlemoncheesecake-requests provides logging facilities to `requests <https://docs.python-requests.org/>`_ for\ntests written with the `lemoncheesecake <http://lemoncheesecake.io>`_ test framework.\n\nIn this example, we implement a very basic test on a Github API endpoint:\n\n.. code-block:: python\n\n   # suites/github.py\n\n   import lemoncheesecake.api as lcc\n   from lemoncheesecake.matching import *\n   from lemoncheesecake_requests import Session, is_2xx\n\n   @lcc.test()\n   def get_org():\n       session = Session(base_url=\"https://api.github.com\")\n\n       resp = session.get(\"/orgs/lemoncheesecake\"). \\\n         require_status_code(is_2xx()). \\\n         check_json({\n           \"id\": is_integer(),\n           \"name\": equal_to(\"lemoncheesecake\")\n         })\n\n\nWe run the test:\n\n.. code-block:: console\n\n   $ lcc run\n   =================================== github ====================================\n    OK  1 # github.get_org\n\n   Statistics :\n    * Duration: 0.214s\n    * Tests: 1\n    * Successes: 1 (100%)\n    * Failures: 0\n\nAnd here is the report details :\n\n.. image:: https://github.com/lemoncheesecake/lemoncheesecake-requests/blob/master/doc/_static/report-sample.png?raw=true\n    :alt: test result\n\nInstallation\n------------\n\nInstall through pip:\n\n.. code-block:: console\n\n   $ pip install lemoncheesecake-requests\n\nlemoncheesecake-requests is compatible with Python 3.7-3.10.\n\nFeatures\n--------\n\n- request/response data logging into lemoncheesecake\n\n- response status code checking using lemoncheesecake matching mechanism\n\nDocumentation\n-------------\n\nThe documentation is available on https://lemoncheesecake-requests.readthedocs.io.\n\n\nContact\n-------\n\nBug reports and improvement ideas are welcomed in tickets.\nA Google Groups forum is also available for discussions about lemoncheesecake:\nhttps://groups.google.com/forum/#!forum/lemoncheesecake.",
    "bugtrack_url": null,
    "license": "Apache License (Version 2.0)",
    "summary": "Test Storytelling for requests",
    "version": "0.4.0",
    "split_keywords": [
        "qa",
        "testing",
        "lemoncheesecake",
        "requests"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8ce2eac202c9b3eb8d29502439bc2d7c54639f2be478ccfc10e19d9dc3d6b1bd",
                "md5": "10d1d1439c4d1bb1300599980102c4c6",
                "sha256": "eba0db3451faa92a64e8296e5904c7a1b9c8dc6ca2d9dd2732c75e68bbc5fa8d"
            },
            "downloads": -1,
            "filename": "lemoncheesecake-requests-0.4.0.tar.gz",
            "has_sig": false,
            "md5_digest": "10d1d1439c4d1bb1300599980102c4c6",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 7964,
            "upload_time": "2023-01-23T20:07:15",
            "upload_time_iso_8601": "2023-01-23T20:07:15.538110Z",
            "url": "https://files.pythonhosted.org/packages/8c/e2/eac202c9b3eb8d29502439bc2d7c54639f2be478ccfc10e19d9dc3d6b1bd/lemoncheesecake-requests-0.4.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-01-23 20:07:15",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "lemoncheesecake-requests"
}
        
Elapsed time: 0.04287s