Metadata-Version: 2.1
Name: lemoncheesecake-requests
Version: 0.1.0
Summary: Test Storytelling for requests
Home-page: https://lemoncheesecake-requests.readthedocs.io
Author: Nicolas Delon
Author-email: nicolas.delon@gmail.com
License: Apache License (Version 2.0)
Project-URL: Documentation, https://lemoncheesecake-requests.readthedocs.io.
Project-URL: Source, https://github.com/lemoncheesecake/lemoncheesecake-requests
Project-URL: Tracker, https://github.com/lemoncheesecake/lemoncheesecake-requests/issues
Keywords: QA testing lemoncheesecake requests
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: MacOS
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Topic :: Software Development :: Quality Assurance
Classifier: Topic :: Software Development :: Testing
License-File: LICENSE.txt

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")
       resp.require_status_code(is_2xx())

       check_that_in(
           resp.json(),
           "id", is_integer(),
           "name", equal_to("lemoncheesecake")
       )


We run the test:

.. code-block:: console

   $ lcc.py 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.6-3.9.

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.


