Test Storytelling for requests
Project description
lemoncheesecake-requests provides logging facilities to requests for tests written with the lemoncheesecake test framework.
In this example, we implement a very basic test on a Github API endpoint:
# 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:
$ 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 :
Installation
Install through pip:
$ 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.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Hashes for lemoncheesecake-requests-0.3.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | a07c3c377a853fd5f37f1c7ffa877fe7920d200cce48c1336134af4b99c3805a |
|
MD5 | 89a99decc0351fe20143ab78553d9b13 |
|
BLAKE2b-256 | a4de0aa34b3b7b69565d3da8fb9118355571e58422cd20fcc6b69fc8f059d20f |